home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / fax / leffler / v2.1.0.patch-6 < prev    next >
Encoding:
Text File  |  1993-08-16  |  70.0 KB  |  2,214 lines

  1. #! /bin/sh
  2. # patch script for converting a36 to a41
  3. TOP=.
  4.  
  5. Patch()
  6. {
  7.     echo "Patch $1:"; patch -s $TOP/$1
  8. }
  9.  
  10. NewFile()
  11. {
  12.     echo "New file $1"; cat >$TOP/$1
  13. }
  14.  
  15. NewDir()
  16. {
  17.     echo "New directory $1"; mkdir $TOP/$1
  18. }
  19.  
  20. RmFile()
  21. {
  22.     echo "Remove $1"; rm -f $TOP/$1.orig; mv $TOP/$1 $TOP/$1.orig
  23. }
  24.  
  25. Patch CHANGES-v2.2<<'EOF-EOF-EOF'
  26. 1c1
  27. < $Header: /usr/people/sam/fax/RCS/CHANGES-v2.2,v 1.8 93/07/27 16:00:53 sam Exp $
  28. ---
  29. > $Header: /usr/people/sam/fax/RCS/CHANGES-v2.2,v 1.9 93/08/16 08:05:35 sam Exp $
  30. 15a16,17
  31. >     o most missing function declarations are automatically recognized and
  32. >       handled by the configure script
  33. EOF-EOF-EOF
  34. Patch README<<'EOF-EOF-EOF'
  35. 1c1
  36. < $Header: /usr/people/sam/fax/RCS/README,v 1.61 93/07/29 17:40:22 sam Exp $
  37. ---
  38. > $Header: /usr/people/sam/fax/RCS/README,v 1.63 93/08/15 18:45:33 sam Exp $
  39. 54,55c54
  40. < be built from the GNU sources and the files in the gs and libtiff
  41. < directories.
  42. ---
  43. > be built from the GNU sources.
  44. 247,250c246,249
  45. < for use by the facsimile server.  I have successfully used Ghostscript
  46. < 2.5.2 with the fax server.  Version 2.6 should also work; though
  47. < 2.6.1 is known to a bug in the clipping code that is fixed by a later
  48. < patch (apply the official patches 1-4).
  49. ---
  50. > for use by the facsimile server.  Version 2.6.1 is known work, though
  51. > you should be certain to apply patches 1-4.  If you do not apply the
  52. > patches you will run into a bug in the clipping code that is tickled
  53. > by the faxcover program.
  54. 368c367
  55. < Building Ghostscript 2.5.2 with the TIFF Driver
  56. ---
  57. > Building Ghostscript 2.6.x with the TIFF Driver
  58. 371,377c370,373
  59. < build a version of Ghostscript that includes the TIFF driver provided in
  60. < the gs directory.  To do this you need to copy the appropriate source
  61. < files into your gs directory, configure Ghostscript to include the
  62. < "tiffg3" driver, and then build a new binary that includes the driver.
  63. < The file gs/Makefile.sgi is a Makefile for building Ghostscript 2.5.2
  64. < on a Silicon Graphics machine with the TIFF driver.  If you are on an
  65. < SGI machine, you can just do the following:
  66. ---
  67. > build a version of Ghostscript that includes the tiffg3 driver provided
  68. > with Ghostscript.  (Actually, you may find that gs/gdevtiff.c is a newer
  69. > version of this driver.  If so, you should be able to just replace the
  70. > distributed gdevtiff.c with the newer one in the gs directory.)
  71. 379,382c375,382
  72. <     % GS=<directory where Ghostscript 2.5.2 is located>
  73. <     % cp gs/Makefile.sgi gs/gdevtiff.c libtiff/tiff.h $GS
  74. <     % cd $GS
  75. <     % make
  76. ---
  77. > To setup Ghostscript you need to create a Makefile (follow the
  78. > Ghostscript documentation), add "tiffg3.dev" to the list of configured
  79. > devices, and then build a new binary that includes the driver.  Don't
  80. > forget to install Ghostscript and it's associated materials.  Beware
  81. > that on machines with dynamic shared libraries (e.g. SunOS), if you
  82. > link ghostscript with the X11 device driver and use shared X11
  83. > libraries that are not in a standard location, then you may need to
  84. > augment the util/ps2fax.gs.sh script with something of the form:
  85. 384,405d383
  86. < Otherwise you will need to construct a makefile from the Ghostscript
  87. < .mak pieces and configure the TIFF driver.  For example,
  88. <    % cp gs/devs.mak gs/gdevtiff.c libtiff/tiff.h $GS
  89. <    % cd $GS
  90. <    % sh tar_cat
  91. <    % cp unix-ansi.mak Makefile
  92. <    <edit Makefile to add tiffg3.dev to DEVICE_DEV>
  93. <    % make
  94. < Ghostscript 2.6 comes with the TIFF driver included in the distribution.
  95. < Note however that version 2.6.1 has at least one bug that is visible
  96. < when used with the fax software; look for the official patch files for
  97. < the sources in the directory that you obtain the distribution.
  98. < Don't forget to install Ghostscript and it's associated materials.
  99. < Beware that on machines with dynamic shared libraries (e.g. SunOS),
  100. < if you link ghostscript with the X11 device driver and use shared
  101. < X11 libraries that are not in a standard location, then you may need
  102. < to augment the util/ps2fax.gs.sh script with something of the form:
  103. 416c394
  104. <     % zcat <somewhere>/v2.1.src.tar.Z | tar xf -
  105. ---
  106. >     % zcat <somewhere>/v2.2.src.tar.Z | tar xf -
  107. 440c418
  108. <     % tar xf <somewhere>/v2.1.inst.tar
  109. ---
  110. >     % tar xf <somewhere>/v2.2.inst.tar
  111. 452c430
  112. <     % tar xf ../v2.1.inst.tar
  113. ---
  114. >     % tar xf ../v2.2.inst.tar
  115. 845c823
  116. < page.  faxd tracing information is controlled by two con figuration
  117. ---
  118. > page.  faxd tracing information is controlled by two configuration
  119. 897a876,885
  120. > Contributed Software
  121. > --------------------
  122. > You should be able to find contributions from FlexFAX users in the
  123. > contrib subdirectory of the public ftp area where you found this
  124. > software (or look in sgi/fax/contrib on the host sgi.com).  New
  125. > contributions are welcome, so long as their author's identity is
  126. > clearly marked (so that folks don't ask me questions about stuff
  127. > that I know nothing).
  128. 1035,1040c1023,1025
  129. < Ghostscript version 2.5.2 or later can be used to do the PostScript
  130. < imaging needed by the server when built with the TIFF facsimile device
  131. < driver in the gs directory (or supplied in the distribution in versions
  132. < 2.6 and later).  Ghostscript and its fonts can be found at many public
  133. < ftp sites around the Internet.  One good location for obtaining the
  134. < 2.6 version is ftp.cs.wisc.edu:/pub/X/ghostscript*2.6*.
  135. ---
  136. > Ghostscript and its fonts can be found at many public ftp sites around
  137. > the Internet.  One good location for obtaining the 2.6 version is
  138. > ftp.cs.wisc.edu:/pub/X/ghostscript*2.6*.
  139. EOF-EOF-EOF
  140. Patch configure<<'EOF-EOF-EOF'
  141. 2c2
  142. < #    $Header: /usr/people/sam/fax/RCS/configure,v 1.74 93/07/29 11:14:04 sam Exp $
  143. ---
  144. > #    $Header: /usr/people/sam/fax/RCS/configure,v 1.80 93/08/16 08:05:17 sam Exp $
  145. 47,48c47
  146. <     (for i
  147. <      do
  148. ---
  149. >     (for i do
  150. 96a96
  151. >     @HP-UX)    TARGET=hpux;;
  152. 155a156,159
  153. > hpux|hpux-gcc)
  154. >     TARGET=hpux COMPILER=gcc
  155. >     warnUnfinished $TARGET
  156. >     ;;
  157. 340,341c344
  158. <     for i
  159. <     do
  160. ---
  161. >     for i do
  162. 355,387d357
  163. < sgi-cc)
  164. <     #
  165. <     # Patch C++ options to remove -v2 option that forces
  166. <     # the CC frontend to use the old 2.1 compiler.
  167. <     #
  168. <     VERS=`versions 'c++.sw' | \
  169. <     grep 'c++' | sed -e 's/.*C++,[ ]*//;q'`
  170. <     case "$VERS" in
  171. <     3.0|2.*)
  172. <     ;;
  173. <     *)  VERS=`versions 'maint_c++.c++_sw' | \
  174. <     grep 'c++' | sed -e 's/.*C++,[ ]*//;q'`
  175. <     ;;
  176. <     esac
  177. <     if [ -z "$VERS" ]; then
  178. <     VERS="2.1"
  179. <     fi
  180. <     case "$VERS" in
  181. <     3.0)
  182. <     echo "You look to have a $VERS C++ compiler; using"
  183. <     echo "the -v2 option to get the 2.1 version compiler."
  184. <     ;;
  185. <     2.*)
  186. <     echo "You've got a $VERS compiler; removing the -v2"
  187. <     echo "option used with the 3.0 compiler system."
  188. <     editFile defs '/^GC++OPTS=/s/[ ]*-v2//'
  189. <         ;;
  190. <     *)
  191. <     echo "I can't figure out what version of the compiler you have!"
  192. <     exit 1
  193. <     ;;
  194. <     esac
  195. <     ;;
  196. 395,398c365,368
  197. < # supported and modify defs accordingly.  This whole part
  198. < # of the configuration process needs lots of work.  At the
  199. < # very least, it should be done dynamically rather than
  200. < # according to the target system.
  201. ---
  202. > # supported.  We craft a port.h file that has external
  203. > # declarations for missing routines that are required by
  204. > # the system and modify defs to reflect which optional
  205. > # interfaces are supported.
  206. 399a370,386
  207. > #
  208. > # Look for a function in one of the standard libraries.
  209. > #
  210. > CheckFunc()
  211. > {
  212. >     echo "extern int $1(); main(){$1();exit(0);}" >t.c
  213. >     (echo DEPTH=.; cat defs; echo 't:; ${CCF} t.c') | \
  214. >      make -f - t 2>&1 >/dev/null &&
  215. >     echo "Configuring use of $1()."
  216. >     return
  217. > }
  218. > $RM port.h a.out t.c t.c++
  219. > HasFchown= ; CheckFunc fchown && HasFchown="yes"
  220. > HasFchmod= ; CheckFunc fchmod && HasFchmod="yes"
  221. 401,406c388,393
  222. < case $TARGET in
  223. < sco*)    sysopts="-DSYS_FCHOWN=0 -DSYS_FCHMOD=0";;
  224. < *)    sysopts="-DSYS_FCHOWN=1 -DSYS_FCHMOD=1";;
  225. < esac
  226. < echo "Patching defs to reflect system support."
  227. < editFile defs "/^GC++DEFS=/s/\$/ $sysopts/" "/^GCDEFS=/s/\$/ $sysopts/"
  228. ---
  229. > test "$HasFchmod" && sysopts="$sysopts -DHAS_FCHMOD=1"
  230. > test "$HasFchown" && sysopts="$sysopts -DHAS_FCHOWN=1"
  231. > if [ "$sysopts" ]; then
  232. >     echo "Patching defs to reflect system support."
  233. >     editFile defs "/^GC++DEFS=/s/\$/ $sysopts/" "/^GCDEFS=/s/\$/ $sysopts/"
  234. > fi
  235. 408a396,482
  236. > # Look for a function declaration in system include files.
  237. > #
  238. > CheckDecl()
  239. > {
  240. >     f=$1; shift
  241. >     (for i do
  242. >     echo "#include \"$i\""
  243. >      done)>t.c++
  244. >     (echo DEPTH=.; cat defs; echo 't:; ${C++F} ${C++FILE} -E t.c++') |\
  245. >      make -f - t 2>&1 |\
  246. >      grep "$f[ ]*(.*)" >/dev/null
  247. >     return
  248. > }
  249. > #
  250. > # Look for a #define in system include files.
  251. > #
  252. > CheckDefine()
  253. > {
  254. >     def=$1; shift
  255. >     (for i do
  256. >     echo "#include \"$i\""
  257. >      done
  258. >      for i in "#ifdef $def" "FOUND $def" "#endif"; do
  259. >     echo "$i"
  260. >      done
  261. >     )>t.c
  262. >     (echo DEPTH=.; cat defs; echo 't:; ${CCF} -E t.c') |\
  263. >      make -f - t 2>&1 |\
  264. >      grep "FOUND[ ]*$def" >/dev/null
  265. >     return
  266. > }
  267. > echo "Creating port.h with missing function declarations."
  268. > (cat<<'EOF'
  269. > /* warning, this file was automatically created by the configure script */
  270. > #ifdef __cplusplus
  271. > extern "C" {
  272. > #endif
  273. > EOF
  274. > CheckDecl mkstemp stdio.h || echo 'extern int mkstemp(char *);'
  275. > CheckDecl strerror string.h || echo 'extern char* strerror(int);'
  276. > CheckDecl strncasecmp string.h ||
  277. >     echo 'extern int strncasecmp(const char*, const char*, size_t);'
  278. > CheckDecl waitpid sys/wait.h || echo 'extern pid_t waitpid(pid_t, int *, int);'
  279. > CheckDefine howmany sys/types.h || {
  280. >     echo '#ifndef howmany'
  281. >     echo '#define howmany(x, y)    (((x)+((y)-1))/(y))'
  282. >     echo '#endif'
  283. > }
  284. > CheckDecl close unistd.h || echo 'extern int close(int);'
  285. > CheckDecl seteuid unistd.h || echo 'extern int seteuid(uid_t);'
  286. > CheckDecl setegid unistd.h || echo 'extern int setegid(gid_t);'
  287. > if [ "$HasFchown" ]; then
  288. >     CheckDecl fchown unistd.h || echo 'extern int fchown(int, uid_t, int);'
  289. > fi
  290. > CheckDecl gethostname osfcn.h || echo 'extern int gethostname(char*, int);'
  291. > CheckDecl malloc stdlib.h || echo 'extern void* malloc(size_t);'
  292. > CheckDecl realloc stdlib.h || echo 'extern void* realloc(void*, size_t);'
  293. > CheckDecl free stdlib.h || echo 'extern void free(void*);'
  294. > CheckDecl strtoul stdlib.h ||
  295. >     echo 'extern unsigned long strtoul(const char*, char**, int);'
  296. > CheckDecl getopt stdlib.h || {
  297. >     echo 'extern char* optarg;'
  298. >     echo 'extern int opterr, optind, optopt;'
  299. >     echo 'extern int getopt(int, char **, char *);'
  300. > }
  301. > CheckDecl syslog syslog.h || echo 'extern void syslog(int, const char*, ...);'
  302. > CheckDecl vsyslog syslog.h || {
  303. >     echo '#include <stdarg.h>'
  304. >     echo 'extern void vsyslog(int, const char*, va_list);'
  305. > }
  306. > CheckDecl closelog syslog.h || echo 'extern void closelog(void);'
  307. > CheckDecl openlog syslog.h || echo 'extern void openlog(const char*, int, int);'
  308. > if [ "$HasFchmod" ]; then
  309. >     CheckDecl fchmod unistd.h libc.h osfcn.h ||
  310. >     echo 'extern int fchmod(int, int);'
  311. > fi
  312. > cat<<'EOF'
  313. > #ifdef __cplusplus
  314. > }
  315. > #endif
  316. > EOF
  317. > )>port.h; chmod 444 port.h
  318. > $RM a.out t.c t.c++
  319. > #
  320. 532c606
  321. <         y=`sed -e '/^#/d' $1 | grep -i "$x" | sed -e 's/    .*//;q`
  322. ---
  323. >         y=`sed -e '/^#/d' $1 | grep -i "$x" | sed -e 's/    .*//;q'`
  324. EOF-EOF-EOF
  325. Patch distrules<<'EOF-EOF-EOF'
  326. 1c1
  327. < #    $Header: /usr/people/sam/fax/RCS/distrules,v 1.69 93/08/01 11:30:40 sam Exp $
  328. ---
  329. > #    $Header: /usr/people/sam/fax/RCS/distrules,v 1.73 93/08/16 08:05:04 sam Exp $
  330. 43d42
  331. <     port/sun/sys/types.h            \
  332. 55d53
  333. <     port/sgi/getopt.h                \
  334. 57d54
  335. <     port/sgi/sys/types.h            \
  336. 68d64
  337. <     port/bsdi/malloc.h                \
  338. 101a98
  339. >     port/freebsd/signal.h            \
  340. 126d122
  341. <     port/4.4bsd/malloc.h            \
  342. 138d133
  343. <     port/linux/sys/types.h            \
  344. 142d136
  345. <     port/generic/getopt.h            \
  346. 227d220
  347. <     gs/Makefile.sgi                \
  348. 229d221
  349. <     gs/devs.mak                \
  350. 348c340,341
  351. <     faxmail/mailfax.sh            \
  352. ---
  353. >     faxmail/mailfax.sh-sendmail        \
  354. >     faxmail/mailfax.sh-smail        \
  355. 448c441,452
  356. <     libtiff/machdep.h                \
  357. ---
  358. >     libtiff/Makefile.aix            \
  359. >     libtiff/Makefile.apollo            \
  360. >     libtiff/Makefile.gcc            \
  361. >     libtiff/Makefile.hpux            \
  362. >     libtiff/Makefile.mips            \
  363. >     libtiff/Makefile.mpw            \
  364. >     libtiff/Makefile.next            \
  365. >     libtiff/Makefile.sco            \
  366. >     libtiff/Makefile.sgi            \
  367. >     libtiff/Makefile.sun            \
  368. >     libtiff/Makefile.tahoe            \
  369. >     libtiff/Makefile.vax            \
  370. 449a454,458
  371. >     libtiff/tiff.h                \
  372. >     libtiff/tiffcomp.h                \
  373. >     libtiff/tiffconf.h                \
  374. >     libtiff/tiffio.h                \
  375. >     libtiff/tiffiop.h                \
  376. 451,454c460,494
  377. <     libtiff/tiff*.h                \
  378. <     libtiff/mk*.c                \
  379. <     libtiff/tif_*.c                \
  380. <     libtiff/Makefile.*                \
  381. ---
  382. >     libtiff/mkg3states.c            \
  383. >     libtiff/mkspans.c                \
  384. >     libtiff/tif_apple.c                \
  385. >     libtiff/tif_aux.c                \
  386. >     libtiff/tif_ccittrle.c            \
  387. >     libtiff/tif_close.c                \
  388. >     libtiff/tif_compress.c            \
  389. >     libtiff/tif_dir.c                \
  390. >     libtiff/tif_dirinfo.c            \
  391. >     libtiff/tif_dirread.c            \
  392. >     libtiff/tif_dirwrite.c            \
  393. >     libtiff/tif_dumpmode.c            \
  394. >     libtiff/tif_error.c                \
  395. >     libtiff/tif_fax3.c                \
  396. >     libtiff/tif_fax4.c                \
  397. >     libtiff/tif_flush.c                \
  398. >     libtiff/tif_getimage.c            \
  399. >     libtiff/tif_jpeg.c                \
  400. >     libtiff/tif_lzw.c                \
  401. >     libtiff/tif_machdep.c            \
  402. >     libtiff/tif_msdos.c                \
  403. >     libtiff/tif_next.c                \
  404. >     libtiff/tif_open.c                \
  405. >     libtiff/tif_packbits.c            \
  406. >     libtiff/tif_print.c                \
  407. >     libtiff/tif_read.c                \
  408. >     libtiff/tif_strip.c                \
  409. >     libtiff/tif_swab.c                \
  410. >     libtiff/tif_thunder.c            \
  411. >     libtiff/tif_tile.c                \
  412. >     libtiff/tif_unix.c                \
  413. >     libtiff/tif_version.c            \
  414. >     libtiff/tif_vms.c                \
  415. >     libtiff/tif_warning.c            \
  416. >     libtiff/tif_write.c                \
  417. 466,471d505
  418. < # Contributed stuff.
  419. < #
  420. < CONTRIBFILES=\
  421. <     contrib/dirk                \
  422. <     ${NULL}
  423. < #
  424. 479d512
  425. <     ${CONTRIBFILES}                \
  426. EOF-EOF-EOF
  427. Patch dist/flexfax.alpha<<'EOF-EOF-EOF'
  428. 1c1
  429. < define ALPHA 036
  430. ---
  431. > define ALPHA 041
  432. EOF-EOF-EOF
  433. Patch etc/faxaddmodem.sh<<'EOF-EOF-EOF'
  434. 2c2
  435. < #    $Header: /usr/people/sam/fax/etc/RCS/faxaddmodem.sh,v 1.60 93/07/29 13:21:28 sam Exp $
  436. ---
  437. > #    $Header: /usr/people/sam/fax/etc/RCS/faxaddmodem.sh,v 1.62 93/08/12 08:44:44 sam Exp $
  438. 147c147
  439. < elif [ -f /etc/useradd ]; then
  440. ---
  441. > elif [ -f /etc/useradd -o -f /usr/sbin/useradd ]; then
  442. 423,434c423,446
  443. < x=`ypcat services 2>/dev/null | grep '^fax[     ]'` 2>/dev/null
  444. < if [ -z "$x" -a -f $SERVICES ]; then
  445. <     x=`grep '^fax[     ]' $SERVICES`
  446. < fi
  447. < if [ -z "$x" ]; then
  448. <     echo ""
  449. <     echo "There does not appear to be an entry for the fax service either in"
  450. <     echo "the yellow pages database or in the $SERVICES file;"
  451. <     prompt "should an entry be added to $SERVICES [yes]?"
  452. <     read x
  453. <     if [ "$x" = "" -o "$x" = "y" -o "$x" = "yes" ]; then
  454. <     echo "fax        4557/tcp        # FAX transmission service" >>$SERVICES
  455. ---
  456. > hasYP=`ypcat services 2>/dev/null | tail -1'` 2>/dev/null
  457. > x=
  458. > if [ "$hasYP" ]; then
  459. >     x=`ypcat services 2>/dev/null | grep '^fax[     ]'` 2>/dev/null
  460. >     if [ -z "$x" ]; then
  461. >     echo ""
  462. >     echo "There does not appear to be an entry for the fax service in the YP database;"
  463. >     echo "the software will not work properly without one.  Contact your administrator"
  464. >     echo "to get the folllowing entry added:"
  465. >     echo ""
  466. >     echo "fax    4557/tcp        # FAX transmission service"
  467. >     echo ""
  468. >     exit 1
  469. >     fi
  470. > else
  471. >     x=`grep '^fax[     ]' $SERVICES 2>/dev/null` 2>/dev/null
  472. >     if [ -z "$x" ]; then
  473. >     echo ""
  474. >     echo "There does not appear to be an entry for the fax service in the $SERVICES file;"
  475. >     prompt "should an entry be added to $SERVICES [yes]?"
  476. >     read x
  477. >     if [ "$x" = "" -o "$x" = "y" -o "$x" = "yes" ]; then
  478. >         echo "fax        4557/tcp        # FAX transmission service" >>$SERVICES
  479. >     fi
  480. EOF-EOF-EOF
  481. Patch etc/probemodem.sh<<'EOF-EOF-EOF'
  482. 2c2
  483. < #    $Header: /usr/people/sam/fax/etc/RCS/probemodem.sh,v 1.3 93/07/29 18:58:53 sam Exp $
  484. ---
  485. > #    $Header: /usr/people/sam/fax/etc/RCS/probemodem.sh,v 1.4 93/08/09 09:14:16 sam Exp $
  486. 151c151
  487. < SunOS)
  488. ---
  489. > SunOS|Linux)
  490. 159,161c159,161
  491. <     PORT=`expr $TTY : 'tty\(.*\)'`    echo "Serial port: $PORT"
  492. <     LOCKX="$LOCKDIR/LCK..$TTY"        echo "UUCP lock file: $LOCKX"
  493. <     DEVS=/dev/$TTY tdev=/dev/$TTY    echo "TTY device: $DEVS"
  494. ---
  495. >     PORT=`expr $TTY : 'tty\(.*\)'`;    echo "Serial port: $PORT"
  496. >     LOCKX="$LOCKDIR/LCK..$TTY";        echo "UUCP lock file: $LOCKX"
  497. >     DEVS=/dev/$TTY; tdev=/dev/$TTY;    echo "TTY device: $DEVS"
  498. 260c260
  499. <     pat=`echo "$i"|sed -e 's/[+*&$\\]/\\\\&/g'`    # escape regex metacharacters
  500. ---
  501. >     pat=`echo "$i"|sed -e 's/[*&$\\]/\\\\&/g'`    # escape regex metacharacters
  502. 305c305
  503. <     pat=`echo "$i"|sed -e 's/[+*&$\\]/\\\\&/g'`    # escape regex metacharacters
  504. ---
  505. >     pat=`echo "$i"|sed -e 's/[*&$\\]/\\\\&/g'`    # escape regex metacharacters
  506. EOF-EOF-EOF
  507. Patch faxalter/faxalter.c++<<'EOF-EOF-EOF'
  508. 1c1
  509. < /*    $Header: /usr/people/sam/fax/faxalter/RCS/faxalter.c++,v 1.6 93/07/26 10:59:42 sam Exp $
  510. ---
  511. > /*    $Header: /usr/people/sam/fax/faxalter/RCS/faxalter.c++,v 1.9 93/08/16 08:21:23 sam Exp $
  512. 29c29
  513. < #include <getopt.h>
  514. ---
  515. > #include <stdlib.h>
  516. 32,35d31
  517. < #ifdef __GNUC__
  518. < extern "C" char* strerror(int);        // XXX should be in <string.h>
  519. < #endif
  520. 63c59
  521. <     int c;
  522. ---
  523. >     int c, n;
  524. 100c96
  525. <         int n = atoi(optarg);
  526. ---
  527. >         n = atoi(optarg);
  528. EOF-EOF-EOF
  529. Patch faxcover/faxcover.c++<<'EOF-EOF-EOF'
  530. 1c1
  531. < /*    $Header: /usr/people/sam/fax/faxcover/RCS/faxcover.c++,v 1.23 93/06/23 14:03:43 sam Exp $
  532. ---
  533. > /*    $Header: /usr/people/sam/fax/faxcover/RCS/faxcover.c++,v 1.25 93/08/15 11:23:02 sam Exp $
  534. 30d29
  535. < #include <getopt.h>
  536. EOF-EOF-EOF
  537. Patch faxd/Class1.c++<<'EOF-EOF-EOF'
  538. 1c1
  539. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1.c++,v 1.43 93/05/10 17:47:22 sam Exp $
  540. ---
  541. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1.c++,v 1.45 93/08/16 08:20:43 sam Exp $
  542. 99c99
  543. <     class1Cmd("CLASS", 1, AT_OK);
  544. ---
  545. >     atCmd(conf.class1Cmd);
  546. 185c185
  547. <     class1Cmd("CLASS", 1, AT_OK);
  548. ---
  549. >     atCmd(conf.class1Cmd);
  550. 620c620
  551. <     if (FaxModem::atResponse(buf, ms) == AT_OTHER && streq(buf, "+FCERROR", 8))
  552. ---
  553. >     if (FaxModem::atResponse(buf, ms) == AT_OTHER && strneq(buf, "+FCERROR", 8))
  554. EOF-EOF-EOF
  555. Patch faxd/Class1Recv.c++<<'EOF-EOF-EOF'
  556. 1c1
  557. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1Recv.c++,v 1.38 93/07/09 17:30:51 sam Exp $
  558. ---
  559. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1Recv.c++,v 1.40 93/08/16 08:21:01 sam Exp $
  560. 65,67c65,70
  561. <     static const AnswerMsg answer =
  562. <     { "CONNECT", 7,    FaxModem::OK, FaxModem::CALLTYPE_UNKNOWN };
  563. <     return streq(s, answer.msg, answer.len) ? &answer : FaxModem::findAnswer(s);
  564. ---
  565. >     static const AnswerMsg answer = {
  566. >     "CONNECT", 7,
  567. >     FaxModem::AT_NOTHING, FaxModem::OK, FaxModem::CALLTYPE_UNKNOWN
  568. >     };
  569. >     return strneq(s, answer.msg, answer.len) ?
  570. >     &answer : FaxModem::findAnswer(s);
  571. EOF-EOF-EOF
  572. Patch faxd/Class1Send.c++<<'EOF-EOF-EOF'
  573. 1c1
  574. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1Send.c++,v 1.44 93/07/09 14:50:59 sam Exp $
  575. ---
  576. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class1Send.c++,v 1.45 93/08/16 08:20:26 sam Exp $
  577. 448c448
  578. <             u_int nsf = frame.getDataWord();
  579. ---
  580. >             { u_int nsf = frame.getDataWord(); }
  581. 465,466c465,466
  582. <             u_int newDIS = frame.getDIS();
  583. <             if (newDIS != dis) {
  584. ---
  585. >             { u_int newDIS = frame.getDIS();
  586. >               if (newDIS != dis) {
  587. 469a470
  588. >               }
  589. EOF-EOF-EOF
  590. Patch faxd/Class2.c++<<'EOF-EOF-EOF'
  591. 1c1
  592. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2.c++,v 1.62 93/07/20 16:11:19 sam Exp $
  593. ---
  594. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2.c++,v 1.64 93/08/16 08:21:02 sam Exp $
  595. 64c64
  596. <     class2Cmd("CLASS", 2);
  597. ---
  598. >     atCmd(conf.class2Cmd);
  599. 163c163
  600. <     class2Cmd("CLASS", 2);
  601. ---
  602. >     atCmd(conf.class2Cmd);
  603. 385c385
  604. <     if (streq(buf, "+FHNG:", 6)) {
  605. ---
  606. >     if (strneq(buf, "+FHNG:", 6)) {
  607. 388c388
  608. <     } else if (streq(buf, "+FCON", 5))
  609. ---
  610. >     } else if (strneq(buf, "+FCON", 5))
  611. 390c390
  612. <     else if (streq(buf, "+FPOLL", 6))
  613. ---
  614. >     else if (strneq(buf, "+FPOLL", 6))
  615. 392c392
  616. <     else if (streq(buf, "+FDIS:", 6))
  617. ---
  618. >     else if (strneq(buf, "+FDIS:", 6))
  619. 394c394
  620. <     else if (streq(buf, "+FNSF:", 6))
  621. ---
  622. >     else if (strneq(buf, "+FNSF:", 6))
  623. 396c396
  624. <     else if (streq(buf, "+FCSI:", 6))
  625. ---
  626. >     else if (strneq(buf, "+FCSI:", 6))
  627. 398c398
  628. <     else if (streq(buf, "+FPTS:", 6))
  629. ---
  630. >     else if (strneq(buf, "+FPTS:", 6))
  631. 400c400
  632. <     else if (streq(buf, "+FDCS:", 6))
  633. ---
  634. >     else if (strneq(buf, "+FDCS:", 6))
  635. 402c402
  636. <     else if (streq(buf, "+FNSS:", 6))
  637. ---
  638. >     else if (strneq(buf, "+FNSS:", 6))
  639. 404c404
  640. <     else if (streq(buf, "+FTSI:", 6))
  641. ---
  642. >     else if (strneq(buf, "+FTSI:", 6))
  643. 406c406
  644. <     else if (streq(buf, "+FET:", 5))
  645. ---
  646. >     else if (strneq(buf, "+FET:", 5))
  647. EOF-EOF-EOF
  648. Patch faxd/Class2Recv.c++<<'EOF-EOF-EOF'
  649. 1c1
  650. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2Recv.c++,v 1.51 93/03/30 21:51:22 sam Exp $
  651. ---
  652. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2Recv.c++,v 1.53 93/08/16 08:21:03 sam Exp $
  653. 38,41c38,45
  654. <     { "+FCON",        5,    FaxModem::OK,        FaxModem::CALLTYPE_FAX },
  655. <     { "+FDM",        4,    FaxModem::OK,        FaxModem::CALLTYPE_DATA },
  656. <     { "+FHNG:",        6,    FaxModem::NOCARRIER,    FaxModem::CALLTYPE_ERROR },
  657. <     { "VCON",        4,    FaxModem::OK,        FaxModem::CALLTYPE_VOICE },
  658. ---
  659. > { "+FCON",    5,
  660. >   FaxModem::AT_NOTHING, FaxModem::OK,        FaxModem::CALLTYPE_FAX },
  661. > { "+FDM",    4,
  662. >   FaxModem::AT_NOTHING, FaxModem::OK,        FaxModem::CALLTYPE_DATA },
  663. > { "+FHNG:",    6,
  664. >   FaxModem::AT_NOTHING, FaxModem::NOCARRIER,FaxModem::CALLTYPE_ERROR },
  665. > { "VCON",    4,
  666. >   FaxModem::AT_NOTHING, FaxModem::OK,        FaxModem::CALLTYPE_VOICE },
  667. 49c53
  668. <     if (streq(s, answerMsgs[i].msg, answerMsgs[i].len))
  669. ---
  670. >     if (strneq(s, answerMsgs[i].msg, answerMsgs[i].len))
  671. EOF-EOF-EOF
  672. Patch faxd/Class2Send.c++<<'EOF-EOF-EOF'
  673. 1c1
  674. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2Send.c++,v 1.57 93/07/13 11:45:12 sam Exp $
  675. ---
  676. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2Send.c++,v 1.58 93/08/16 08:21:04 sam Exp $
  677. 57c57
  678. <     if (streq(rbuf, "CED", 3))        // hack for busted modems
  679. ---
  680. >     if (strneq(rbuf, "CED", 3))        // hack for busted modems
  681. 92,94c92,95
  682. <         char* cp = rbuf+6;
  683. <         nsf = fromHex(cp, strlen(cp));    // extract NSF information
  684. <         protoTrace("REMOTE NSF \"%s\"", cp);
  685. ---
  686. >         { char* cp = rbuf+6;
  687. >           nsf = fromHex(cp, strlen(cp));    // extract NSF information
  688. >           protoTrace("REMOTE NSF \"%s\"", cp);
  689. >         }
  690. EOF-EOF-EOF
  691. Patch faxd/DialRules.c++<<'EOF-EOF-EOF'
  692. 1c1
  693. < /*    $Header: /usr/people/sam/fax/faxd/RCS/DialRules.c++,v 1.8 93/06/20 19:14:05 sam Exp $
  694. ---
  695. > /*    $Header: /usr/people/sam/fax/faxd/RCS/DialRules.c++,v 1.9 93/08/08 17:13:31 sam Exp $
  696. 346c346,347
  697. <         while (rule.pat->Search(result, len, 0, len) >= 0) {
  698. ---
  699. >         u_int start = 0;
  700. >         while (rule.pat->Search(result, len, start, len) >= 0) {
  701. 373a375
  702. >         start = ix + replace.length();    // skip replace when searching
  703. EOF-EOF-EOF
  704. Patch faxd/Everex.c++<<'EOF-EOF-EOF'
  705. 1c1
  706. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Everex.c++,v 1.35 93/03/25 16:15:42 sam Exp $
  707. ---
  708. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Everex.c++,v 1.37 93/08/16 08:21:05 sam Exp $
  709. 201c201
  710. <     return (setupFrame(f, (char*) toHex(v, 8)));
  711. ---
  712. >     return (atCmd("#FT" | toHex(f, 2) | "=" | toHex(v, 8)));
  713. 213c213
  714. <     return (getModemLine(buf, ms) > 2 && streq(buf, "R ", 2));
  715. ---
  716. >     return (getModemLine(buf, ms) > 2 && strneq(buf, "R ", 2));
  717. EOF-EOF-EOF
  718. Patch faxd/Everex.h<<'EOF-EOF-EOF'
  719. 1c1
  720. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Everex.h,v 1.38 93/07/09 14:51:01 sam Exp $
  721. ---
  722. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Everex.h,v 1.39 93/08/14 12:38:08 sam Exp $
  723. 107d106
  724. <     CallType    answerResponse(fxStr& emsg);
  725. EOF-EOF-EOF
  726. Patch faxd/EverexRecv.c++<<'EOF-EOF-EOF'
  727. 1c1
  728. < /*    $Header: /usr/people/sam/fax/faxd/RCS/EverexRecv.c++,v 1.45 93/05/10 09:26:46 sam Exp $
  729. ---
  730. > /*    $Header: /usr/people/sam/fax/faxd/RCS/EverexRecv.c++,v 1.47 93/08/16 08:21:06 sam Exp $
  731. 41c41
  732. < EverexModem::answerCall(AnswerType, fxStr& emsg)
  733. ---
  734. > EverexModem::answerCall(AnswerType atype, fxStr& emsg)
  735. 43,56c43,59
  736. <     if (!atCmd("#A#S8=8#S9=45V1&E1S0=0X4"))
  737. <     goto bad;
  738. <     if (!modemFaxConfigure(FAX_RECVMODE|S2_RESET))
  739. <     goto bad;
  740. <     if (!setupFrame(FCF_DIS|FCF_RCVR, modemDIS()))
  741. <     goto bad;
  742. <     if (!setupFrame(FCF_CSI|FCF_RCVR, (char*) lid))
  743. <     goto bad;
  744. <     if (!atCmd("#T2100=30"))
  745. <     goto bad;
  746. <     return (answerResponse(emsg));
  747. < bad:
  748. <     emsg = "Unspecified Receive Phase B error";
  749. <     return (CALLTYPE_ERROR);
  750. ---
  751. >     if (atype == FaxModem::ANSTYPE_FAX || atype == FaxModem::ANSTYPE_ANY) {
  752. >     if (!atCmd("#A#S8=8#S9=45V1&E1S0=0X4"))
  753. >         goto bad;
  754. >     if (!modemFaxConfigure(FAX_RECVMODE|S2_RESET))
  755. >         goto bad;
  756. >     if (!setupFrame(FCF_DIS|FCF_RCVR, modemDIS()))
  757. >         goto bad;
  758. >     if (!setupFrame(FCF_CSI|FCF_RCVR, (char*) lid))
  759. >         goto bad;
  760. >     if (!atCmd("#T2100=30")) {
  761. >     bad:
  762. >         emsg = "Unspecified Receive Phase B error";
  763. >         return (CALLTYPE_ERROR);
  764. >     } else
  765. >         return (CALLTYPE_FAX);
  766. >     }
  767. >     return (FaxModem::answerCall(atype, emsg));
  768. 59,64d61
  769. < CallType
  770. < EverexModem::answerResponse(fxStr&)
  771. < {
  772. <     return (CALLTYPE_FAX);    // XXX can't deduce, assume fax
  773. < }
  774. 157c154
  775. <     while (getModemLine(buf) > 2 && !streq(buf, "M ", 2))
  776. ---
  777. >     while (getModemLine(buf) > 2 && !strneq(buf, "M ", 2))
  778. 161c158
  779. <     fxBool ok = (!wasTimeout() && streq(buf, "M 3", 3));
  780. ---
  781. >     fxBool ok = (!wasTimeout() && strneq(buf, "M 3", 3));
  782. 271c268
  783. <     if (streq(rbuf, "M 1", 3)) {        // message carrier received
  784. ---
  785. >     if (strneq(rbuf, "M 1", 3)) {        // message carrier received
  786. 302c299
  787. <     } else if (streq(rbuf, "R ", 2)) {    // HDLC frames received
  788. ---
  789. >     } else if (strneq(rbuf, "R ", 2)) {    // HDLC frames received
  790. EOF-EOF-EOF
  791. Patch faxd/EverexSend.c++<<'EOF-EOF-EOF'
  792. 1c1
  793. < /*    $Header: /usr/people/sam/fax/faxd/RCS/EverexSend.c++,v 1.48 93/07/09 14:51:02 sam Exp $
  794. ---
  795. > /*    $Header: /usr/people/sam/fax/faxd/RCS/EverexSend.c++,v 1.49 93/08/16 08:21:07 sam Exp $
  796. 49c49
  797. <         if (streq(rbuf, "FAX", 3))
  798. ---
  799. >         if (strneq(rbuf, "FAX", 3))
  800. 284c284
  801. <         if (getModemLine(buf, conf.t4Timer) > 2 && streq(buf, "R ", 2))
  802. ---
  803. >         if (getModemLine(buf, conf.t4Timer) > 2 && strneq(buf, "R ", 2))
  804. 443c443
  805. <     if (getModemLine(rbuf, conf.t4Timer) > 2 && streq(rbuf, "R ", 2))
  806. ---
  807. >     if (getModemLine(rbuf, conf.t4Timer) > 2 && strneq(rbuf, "R ", 2))
  808. EOF-EOF-EOF
  809. Patch faxd/FaxMachineInfo.c++<<'EOF-EOF-EOF'
  810. 1c1
  811. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxMachineInfo.c++,v 1.17 93/07/21 11:27:15 sam Exp $
  812. ---
  813. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxMachineInfo.c++,v 1.19 93/08/15 11:23:20 sam Exp $
  814. 36d35
  815. < extern "C" void syslog(int priority, const char *message, ...);    // XXX
  816. EOF-EOF-EOF
  817. Patch faxd/FaxMachineLog.c++<<'EOF-EOF-EOF'
  818. 1c1
  819. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxMachineLog.c++,v 1.10 93/07/15 10:25:15 sam Exp $
  820. ---
  821. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxMachineLog.c++,v 1.12 93/08/15 11:23:22 sam Exp $
  822. 37,38d36
  823. < extern "C" void syslog(int priority, const char *message, ...);    // XXX
  824. 76,79d73
  825. < #ifdef __GNUC__
  826. < extern "C" char* strerror(int);        // XXX should be in <string.h>
  827. < #endif
  828. EOF-EOF-EOF
  829. Patch faxd/FaxModem.c++<<'EOF-EOF-EOF'
  830. 1c1
  831. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxModem.c++,v 1.76 93/07/13 17:28:06 sam Exp $
  832. ---
  833. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxModem.c++,v 1.79 93/08/16 08:21:08 sam Exp $
  834. 236,243c236,251
  835. <     { "FAX",        3,    FaxModem::OK,        FaxModem::CALLTYPE_FAX },
  836. <     { "DATA",        4,    FaxModem::OK,        FaxModem::CALLTYPE_DATA },
  837. <     { "CONNECT FAX",11,    FaxModem::OK,        FaxModem::CALLTYPE_FAX },
  838. <     { "CONNECT",    7,    FaxModem::OK,        FaxModem::CALLTYPE_DATA },
  839. <     { "NO ANSWER",  9,    FaxModem::NOANSWER,    FaxModem::CALLTYPE_ERROR },
  840. <     { "NO CARRIER", 10,    FaxModem::NOCARRIER,    FaxModem::CALLTYPE_ERROR },
  841. <     { "NO DIALTONE",11,    FaxModem::NODIALTONE,    FaxModem::CALLTYPE_ERROR },
  842. <     { "ERROR",        5,    FaxModem::ERROR,    FaxModem::CALLTYPE_ERROR },
  843. ---
  844. > { "CONNECT FAX",11,
  845. >    FaxModem::AT_NOTHING,    FaxModem::OK,         FaxModem::CALLTYPE_FAX },
  846. > { "CONNECT",     7,
  847. >    FaxModem::AT_NOTHING,    FaxModem::OK,         FaxModem::CALLTYPE_DATA },
  848. > { "NO ANSWER",   9,
  849. >    FaxModem::AT_NOTHING,    FaxModem::NOANSWER,  FaxModem::CALLTYPE_ERROR },
  850. > { "NO CARRIER", 10,
  851. >    FaxModem::AT_NOTHING,    FaxModem::NOCARRIER, FaxModem::CALLTYPE_ERROR },
  852. > { "NO DIALTONE",11,
  853. >    FaxModem::AT_NOTHING,    FaxModem::NODIALTONE,FaxModem::CALLTYPE_ERROR },
  854. > { "ERROR",       5,
  855. >    FaxModem::AT_NOTHING,    FaxModem::ERROR,     FaxModem::CALLTYPE_ERROR },
  856. > { "FAX",     3,
  857. >    FaxModem::AT_CONNECT,    FaxModem::OK,         FaxModem::CALLTYPE_FAX },
  858. > { "DATA",     4,
  859. >    FaxModem::AT_CONNECT,    FaxModem::OK,         FaxModem::CALLTYPE_DATA },
  860. 251c259
  861. <     if (streq(s, answerMsgs[i].msg, answerMsgs[i].len))
  862. ---
  863. >     if (strneq(s, answerMsgs[i].msg, answerMsgs[i].len))
  864. 265a274
  865. > again:
  866. 271a281,298
  867. >         if (am->expect != AT_NOTHING && conf.waitForConnect) {
  868. >         /*
  869. >          * Response string is an intermediate result that
  870. >          * is only meaningful if followed by AT response
  871. >          * am->next.  Read the next response from the modem
  872. >          * and if it's the expected one, use the message
  873. >          * to intuit the call type.  Otherwise, discard
  874. >          * the intermediate response string and process the
  875. >          * call according to the newly read response.
  876. >          * This is intended to deal with modems that send
  877. >          *   <something>
  878. >          *   CONNECT
  879. >          * (such as the Boca 14.4).
  880. >          */
  881. >         r = atResponse(rbuf, conf.answerResponseTimeout);
  882. >         if (r != am->expect)
  883. >             goto again;
  884. >         }
  885. 1173c1200
  886. <     else if (streq(buf, "OK", 2))
  887. ---
  888. >     else if (strneq(buf, "OK", 2))
  889. 1175c1202
  890. <     else if (streq(buf, "NO CARRIER", 10))
  891. ---
  892. >     else if (strneq(buf, "NO CARRIER", 10))
  893. 1177c1204
  894. <     else if (streq(buf, "NO DIAL", 7))        // NO DIALTONE or NO DIAL TONE
  895. ---
  896. >     else if (strneq(buf, "NO DIAL", 7))        // NO DIALTONE or NO DIAL TONE
  897. 1179c1206
  898. <     else if (streq(buf, "NO ANSWER", 9))
  899. ---
  900. >     else if (strneq(buf, "NO ANSWER", 9))
  901. 1181c1208
  902. <     else if (streq(buf, "ERROR", 5))
  903. ---
  904. >     else if (strneq(buf, "ERROR", 5))
  905. 1183c1210
  906. <     else if (streq(buf, "CONNECT", 7))
  907. ---
  908. >     else if (strneq(buf, "CONNECT", 7))
  909. 1185c1212
  910. <     else if (streq(buf, "RING", 4))
  911. ---
  912. >     else if (strneq(buf, "RING", 4))
  913. 1187c1214
  914. <     else if (streq(buf, "BUSY", 4))
  915. ---
  916. >     else if (strneq(buf, "BUSY", 4))
  917. 1189c1216
  918. <     else if (streq(buf, "PHONE OFF-HOOK", 14))
  919. ---
  920. >     else if (strneq(buf, "PHONE OFF-HOOK", 14))
  921. 1202,1203c1229,1235
  922. <     if (r != AT_NOTHING && !waitFor(r, ms))
  923. <         return (FALSE);
  924. ---
  925. >     if (r != AT_NOTHING) {
  926. >         if (!waitFor(r, ms))
  927. >         return (FALSE);
  928. >     } else if (pos != cmd.length()) {
  929. >         if (!waitFor(AT_OK, ms))
  930. >         return (FALSE);
  931. >     }
  932. EOF-EOF-EOF
  933. Patch faxd/FaxModem.h<<'EOF-EOF-EOF'
  934. 1c1
  935. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxModem.h,v 1.67 93/07/13 17:27:43 sam Exp $
  936. ---
  937. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxModem.h,v 1.69 93/08/16 08:21:09 sam Exp $
  938. 48,51c48,52
  939. <     const char*    msg;
  940. <     u_int    len;
  941. <     CallStatus    status;
  942. <     CallType    type;
  943. ---
  944. >     const char*    msg;        // string to match
  945. >     u_short    len;        // string length
  946. >     ATResponse    expect;        // next AT response to expect
  947. >     CallStatus    status;        // resultant call status
  948. >     CallType    type;        // resultant call type
  949. 124a126,141
  950. >     enum {            // ATResponse
  951. >     AT_NOTHING    = 0,    // for passing as a parameter
  952. >     AT_OK        = 1,    // "OK" response
  953. >     AT_CONNECT    = 2,    // "CONNECT" response
  954. >     AT_NOANSWER    = 3,    // "NO ANSWER" response
  955. >     AT_NOCARRIER    = 4,    // "NO CARRIER" response
  956. >     AT_NODIALTONE    = 5,    // "NO DIALTONE" response
  957. >     AT_BUSY        = 6,    // "BUSY" response
  958. >     AT_OFFHOOK    = 7,    // "PHONE OFF-HOOK" response
  959. >     AT_RING        = 8,    // "RING" response
  960. >     AT_ERROR    = 9,    // "ERROR" response
  961. >     AT_EMPTYLINE    = 10,    // empty line (0 characters received)
  962. >     AT_TIMEOUT    = 11,    // timeout waiting for response
  963. >     AT_OTHER    = 12,    // unknown response (not one of above)
  964. >     };
  965. 207,221d223
  966. <     enum {            // ATResponse
  967. <     AT_NOTHING    = 0,    // for passing as a parameter
  968. <     AT_OK        = 1,    // "OK" response
  969. <     AT_CONNECT    = 2,    // "CONNECT" response
  970. <     AT_NOANSWER    = 3,    // "NO ANSWER" response
  971. <     AT_NOCARRIER    = 4,    // "NO CARRIER" response
  972. <     AT_NODIALTONE    = 5,    // "NO DIALTONE" response
  973. <     AT_BUSY        = 6,    // "BUSY" response
  974. <     AT_OFFHOOK    = 7,    // "PHONE OFF-HOOK" response
  975. <     AT_RING        = 8,    // "RING" response
  976. <     AT_ERROR    = 9,    // "ERROR" response
  977. <     AT_EMPTYLINE    = 10,    // empty line (0 characters received)
  978. <     AT_TIMEOUT    = 11,    // timeout waiting for response
  979. <     AT_OTHER    = 12,    // unknown response (not one of above)
  980. <     };
  981. 385,388c387,388
  982. < inline fxBool streq(const char* a, const char* b)
  983. <     { return (strcmp(a,b) == 0); }
  984. < inline fxBool streq(const char* a, const char* b, int n)
  985. <     { return (strncmp(a,b,n) == 0); }
  986. ---
  987. > #define streq(a, b)    (strcmp(a,b) == 0)
  988. > #define    strneq(a, b, n)    (strncmp(a,b,n) == 0)
  989. EOF-EOF-EOF
  990. Patch faxd/FaxRequest.c++<<'EOF-EOF-EOF'
  991. 1c1
  992. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxRequest.c++,v 1.33 93/07/27 11:31:48 sam Exp $
  993. ---
  994. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxRequest.c++,v 1.35 93/08/15 11:23:23 sam Exp $
  995. 29,30d28
  996. < extern "C" void syslog(int priority, const char *message, ...);
  997. EOF-EOF-EOF
  998. Patch faxd/FaxServer.c++<<'EOF-EOF-EOF'
  999. 1c1
  1000. < /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxServer.c++,v 1.119 93/07/31 17:23:09 sam Exp $
  1001. ---
  1002. > /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxServer.c++,v 1.121 93/08/15 11:23:23 sam Exp $
  1003. 31c31
  1004. < #include <getopt.h>
  1005. ---
  1006. > #include <stdlib.h>
  1007. 62,64d61
  1008. < #if SYS_FCHMOD && !defined(__bsdi__) && !defined(svr4) && !defined(BSD4_4) && !defined(__linux__)
  1009. < extern "C" int fchmod(int, int);
  1010. < #endif
  1011. 198c195
  1012. < #if SYS_FCHMOD
  1013. ---
  1014. > #if HAS_FCHMOD
  1015. 486c483
  1016. < #if SYS_FCHOWN
  1017. ---
  1018. > #if HAS_FCHOWN
  1019. 492c489
  1020. < #if SYS_FCHMOD
  1021. ---
  1022. > #if HAS_FCHMOD
  1023. EOF-EOF-EOF
  1024. Patch faxd/Getty.c++<<'EOF-EOF-EOF'
  1025. 1c1
  1026. < /*    $Header: /usr/people/sam/fax/faxd/RCS/Getty.c++,v 1.18 93/07/29 13:20:34 sam Exp $
  1027. ---
  1028. > /*    $Header: /usr/people/sam/fax/faxd/RCS/Getty.c++,v 1.20 93/08/15 11:23:24 sam Exp $
  1029. 35,44d34
  1030. < #ifdef __GNUC__
  1031. < extern "C" {
  1032. <     void closelog(void);
  1033. <     void openlog(const char* ident, int lgopt, int facility);
  1034. < };
  1035. < #endif
  1036. < #include <stdarg.h>
  1037. < extern "C" void vsyslog(int, const char*, va_list ap);    // XXX
  1038. EOF-EOF-EOF
  1039. Patch faxd/GettyBSD.c++<<'EOF-EOF-EOF'
  1040. 1c1
  1041. < /*    $Header: /usr/people/sam/fax/faxd/RCS/GettyBSD.c++,v 1.20 93/07/29 13:21:13 sam Exp $
  1042. ---
  1043. > /*    $Header: /usr/people/sam/fax/faxd/RCS/GettyBSD.c++,v 1.22 93/08/15 11:23:25 sam Exp $
  1044. 206,207d205
  1045. < extern "C" pid_t waitpid(pid_t, int *, int);
  1046. EOF-EOF-EOF
  1047. Patch faxd/GettySysV.c++<<'EOF-EOF-EOF'
  1048. 1c1
  1049. < /*    $Header: /usr/people/sam/fax/faxd/RCS/GettySysV.c++,v 1.21 93/07/29 13:21:14 sam Exp $
  1050. ---
  1051. > /*    $Header: /usr/people/sam/fax/faxd/RCS/GettySysV.c++,v 1.23 93/08/15 11:23:26 sam Exp $
  1052. EOF-EOF-EOF
  1053. Patch faxd/HDLCFrame.c++<<'EOF-EOF-EOF'
  1054. 1c1
  1055. < /*    $Header: /usr/people/sam/fax/faxd/RCS/HDLCFrame.c++,v 1.7 93/05/10 16:24:50 sam Exp $
  1056. ---
  1057. > /*    $Header: /usr/people/sam/fax/faxd/RCS/HDLCFrame.c++,v 1.9 93/08/15 11:23:26 sam Exp $
  1058. 30,31c30,31
  1059. < #include "libc.h"
  1060. < #include "malloc.h"
  1061. ---
  1062. > #include <string.h>
  1063. > #include <stdlib.h>
  1064. EOF-EOF-EOF
  1065. Patch faxd/ModemConfig.c++<<'EOF-EOF-EOF'
  1066. 1c1
  1067. < /*    $Header: /usr/people/sam/fax/faxd/RCS/ModemConfig.c++,v 1.18 93/06/22 18:20:16 sam Exp $
  1068. ---
  1069. > /*    $Header: /usr/people/sam/fax/faxd/RCS/ModemConfig.c++,v 1.21 93/08/16 08:21:10 sam Exp $
  1070. 58a59,60
  1071. >     , class1Cmd("+FCLASS=1")        // set class 1 (fax)
  1072. >     , class2Cmd("+FCLASS=2")        // set class 2 (fax)
  1073. 100a103
  1074. >     waitForConnect = FALSE;        // unique answer response from modem
  1075. 106a110,112
  1076. > #ifdef streq
  1077. > #undef streq
  1078. > #endif
  1079. 205a212,213
  1080. >     else if (streq(tag, "ModemWaitForConnect"))
  1081. >     waitForConnect = getBoolean(value);
  1082. 218a227,228
  1083. >     // Class 1-specific configuration controls
  1084. >     else if (streq(tag, "Class1Cmd"))        class1Cmd = value;
  1085. 234a245
  1086. >     else if (streq(tag, "Class2Cmd"))        class2Cmd = value;
  1087. EOF-EOF-EOF
  1088. Patch faxd/ModemConfig.h<<'EOF-EOF-EOF'
  1089. 1c1
  1090. < /*    $Header: /usr/people/sam/fax/faxd/RCS/ModemConfig.h,v 1.16 93/06/22 18:19:57 sam Exp $
  1091. ---
  1092. > /*    $Header: /usr/people/sam/fax/faxd/RCS/ModemConfig.h,v 1.18 93/08/14 11:36:08 sam Exp $
  1093. 63a64
  1094. >     fxStr    class1Cmd;        // cmd for setting Class 1
  1095. 71a73
  1096. >     fxStr    class2Cmd;        // cmd for setting Class 2
  1097. 89a92
  1098. >     fxBool    waitForConnect;        // modem sends multiple answer responses
  1099. EOF-EOF-EOF
  1100. Patch faxd/UUCPLock.c++<<'EOF-EOF-EOF'
  1101. 1c1
  1102. < /*    $Header: /usr/people/sam/fax/faxd/RCS/UUCPLock.c++,v 1.19 93/07/08 16:51:51 sam Exp $
  1103. ---
  1104. > /*    $Header: /usr/people/sam/fax/faxd/RCS/UUCPLock.c++,v 1.21 93/08/15 11:23:27 sam Exp $
  1105. 49,51d48
  1106. < #if SYS_FCHMOD && !defined(__bsdi__) && !defined(svr4) && !defined(BSD4_4) && !defined(__linux__)
  1107. < extern "C" int fchmod(int, int);
  1108. < #endif
  1109. 110c107
  1110. < #if SYS_FCHMOD
  1111. ---
  1112. > #if HAS_FCHMOD
  1113. 115c112
  1114. < #if SYS_FCHOWN
  1115. ---
  1116. > #if HAS_FCHOWN
  1117. EOF-EOF-EOF
  1118. Patch faxd/everex.h<<'EOF-EOF-EOF'
  1119. 1c1
  1120. < /*    $Header: /usr/people/sam/fax/faxd/RCS/everex.h,v 1.7 93/01/13 18:50:03 sam Exp $
  1121. ---
  1122. > /*    $Header: /usr/people/sam/fax/faxd/RCS/everex.h,v 1.8 93/08/14 12:21:38 sam Exp $
  1123. 30c30
  1124. < #define    EVEREX_CMDBRATE    BR1200        // command interface is fixed at 1200 baud
  1125. ---
  1126. > #define    EVEREX_CMDBRATE    BR2400        // cmd interface is fixed at 2400 baud
  1127. EOF-EOF-EOF
  1128. Patch faxd/faxServerApp.c++<<'EOF-EOF-EOF'
  1129. 1c1
  1130. < /*    $Header: /usr/people/sam/fax/faxd/RCS/faxServerApp.c++,v 1.116 93/07/27 11:28:02 sam Exp $
  1131. ---
  1132. > /*    $Header: /usr/people/sam/fax/faxd/RCS/faxServerApp.c++,v 1.120 93/08/16 08:19:57 sam Exp $
  1133. 25d24
  1134. < #include <getopt.h>
  1135. 39a39,40
  1136. > #include <stdlib.h>
  1137. > #include <sys/wait.h>
  1138. 63,65d63
  1139. < extern "C" void closelog(void);
  1140. < extern "C" void openlog(const char* ident, int lgopt, int facility);
  1141. 553c551
  1142. <     (void) TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample);
  1143. ---
  1144. >     TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample);
  1145. 559c557
  1146. <     (void) TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
  1147. ---
  1148. >     TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
  1149. 564c562
  1150. <     short compression;
  1151. ---
  1152. >     short compression = 0;
  1153. 583c581,584
  1154. <     (void) TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
  1155. ---
  1156. >     if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w)) {
  1157. >     emsg = "Malformed document (no image width)";
  1158. >     return (FALSE);
  1159. >     }
  1160. 635c636,639
  1161. <     (void) TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
  1162. ---
  1163. >     if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h)) {
  1164. >     emsg = "Malformed document (no image length)";
  1165. >     return (FALSE);
  1166. >     }
  1167. 1250,1251d1253
  1168. < extern "C" int waitpid(pid_t, int *, int);
  1169. 1290,1292c1292,1294
  1170. <     int status = 0;
  1171. <     (void) waitpid(pid, &status, 0);
  1172. <     if (status != 0)
  1173. ---
  1174. >     { int status = 0;
  1175. >       (void) waitpid(pid, &status, 0);
  1176. >       if (status != 0)
  1177. 1293a1296
  1178. >     }
  1179. 1462,1463d1464
  1180. < extern "C" void vsyslog(int, const char*, va_list);
  1181. EOF-EOF-EOF
  1182. Patch faxmail/README<<'EOF-EOF-EOF'
  1183. 1c1
  1184. < $Header: /usr/people/sam/fax/faxmail/RCS/README,v 1.6 93/05/20 15:49:58 sam Exp $
  1185. ---
  1186. > $Header: /usr/people/sam/fax/faxmail/RCS/README,v 1.7 93/08/15 18:21:32 sam Exp $
  1187. 5c5
  1188. < Step 1.  Setup the FlexFAX software as usual.
  1189. ---
  1190. > 1. Setup the FlexFAX software as usual.
  1191. 7,8c7,10
  1192. < Step 2.  Edit your sendmail configuration.  Include the following
  1193. < mailer definition (or similar):
  1194. ---
  1195. > 2. If your system uses sendmail to deliver mail, then follow the
  1196. >    instructions in mailfax.sh-sendmail.
  1197. > 3. If your system uses smail (e.g. Linux users), then follow the
  1198. >    instructions in mailfax.sh-smail.
  1199. 10,11c12,14
  1200. < Mfax,    P=/usr/local/lib/fax/mailfax, F=DFMhu, M=100000,
  1201. <     A=mailfax $u $h $f
  1202. ---
  1203. > 4. Restart your mail software, refreeze your configuration or
  1204. >    whatever is necessary to cause the configuration changes to be
  1205. >    seen by the system.
  1206. 13,32d15
  1207. < and add the following address rewriting rule to rule set 0:
  1208. < # forward FAX messages to FlexFAX software
  1209. < R$+<@$+.FAX>        $#fax $@ $2 $: $1        user@host.FAX
  1210. < Step 3.  Create a mailfax shell script that formats the mail and
  1211. < submits the result for transmission.  A simple one is:
  1212. < #! /bin/sh
  1213. < /usr/local/bin/faxmail | /usr/local/bin/sendfax -n -d "$1@$2" -f "$3"
  1214. < Note that the mailfax script must be invoked as either root, daemon, or
  1215. < uucp if the from address is to be changed with the -f option to sendfax.
  1216. < This is typically the case when sendmail invokes a mailer program and
  1217. < the from address identity is different that of the real uid.
  1218. < Step 4.  Restart sendmail, refreeze your configuration, or whatever is
  1219. < necessary to cause the configuration changes to be seen by the system.
  1220. 45d27
  1221. 49a32,33
  1222. > Dirk Husemann's more elaborate scheme is included in the contributed
  1223. > software; check out ../contrib/dirk.
  1224. 51,52c35,38
  1225. < Dirk Husemann's more elaborate scheme is also included in the directory
  1226. < ../contrib/dirk.
  1227. ---
  1228. > There is also the "Remote Printing Experiment" being conducted by folks
  1229. > on the Internet.  This provides a distributed fax delivery service that
  1230. > uses email to relay facsimile to a local site for delivery.  For info
  1231. > about that stuff send mail to tpc-faq@town.hall.org.
  1232. EOF-EOF-EOF
  1233. Patch faxmail/faxmail.c++<<'EOF-EOF-EOF'
  1234. 1c1
  1235. < /*    $Header: /usr/people/sam/fax/faxmail/RCS/faxmail.c++,v 1.18 93/05/17 16:59:15 sam Exp $
  1236. ---
  1237. > /*    $Header: /usr/people/sam/fax/faxmail/RCS/faxmail.c++,v 1.20 93/08/15 11:23:37 sam Exp $
  1238. 30c30
  1239. < #include <getopt.h>
  1240. ---
  1241. > #include <stdlib.h>
  1242. EOF-EOF-EOF
  1243. RmFile faxmail/mailfax.sh
  1244. NewFile faxmail/mailfax.sh-sendmail<<'EOF-EOF-EOF'
  1245. #! /bin/sh
  1246. #
  1247. # mailfax - email to fax gateway for sendmail
  1248. #
  1249. # This file should be installed as /usr/local/bin/mailfax
  1250. #
  1251. # Edit your sendmail configuration.  Include the following
  1252. # mailer definition (or similar):
  1253. # Mfax,    P=/usr/local/lib/fax/mailfax, F=DFMhu, M=100000,
  1254. #     A=mailfax $u $h $f
  1255. # and add the following address rewriting rule to rule set 0:
  1256. # # forward FAX messages to FlexFAX software
  1257. # R$+<@$+.FAX>        $#fax $@ $2 $: $1        user@host.FAX
  1258. #
  1259. # Note that the mailfax script must be invoked as either root, daemon, or
  1260. # uucp if the from address is to be changed with the -f option to sendfax.
  1261. # This is typically the case when sendmail invokes a mailer program and
  1262. # the from address identity is different that of the real uid.
  1263. #
  1264. /usr/local/bin/faxmail | /usr/local/bin/sendfax -n -d "$1@$2" -f "$3"
  1265. EOF-EOF-EOF
  1266. NewFile faxmail/mailfax.sh-smail<<'EOF-EOF-EOF'
  1267. #!/bin/sh
  1268. #
  1269. #   mailfax - email to fax gateway for smail3.1.
  1270. #
  1271. #   This file should be installed as /usr/local/bin/mailfax, and the
  1272. #   following changes made to the smail configuration:
  1273. #
  1274. #   Add the following to /usr/local/lib/smail/transports:
  1275. #       fax: driver=pipe, local;
  1276. #           pipe_as_sender, cmd="/usr/local/bin/mailfax"
  1277. #
  1278. #   Add the following to /usr/local/lib/smail/routers:
  1279. #       fax: driver=queryprogram, transport=fax;
  1280. #           cmd="/usr/bin/expr ${lc:host} : '.*\.fax$'"
  1281. #
  1282. #   If you do not already have a routers file, you *must* create one
  1283. #   with the default routing info, included below:
  1284. #       inet_addrs: driver=gethostbyaddr, transport=smtp;
  1285. #           fail_if_error, check_for_local,
  1286. #       inet_hosts: driver=gethostbyname, transport=smtp;
  1287. #           -required, -domain, -only_local_domain,
  1288. #       paths: driver=pathalias, transport=uux;
  1289. #           file=paths, proto=bsearch, optional, -required, domain=uucp,
  1290. #       uucp_neighbors: driver=uuname, transport=uux;
  1291. #           cmd=/usr/bin/uuname, domain=uucp,
  1292. #       smart_host: driver=smarthost, transport=uux;
  1293. #           -path,
  1294. #
  1295. #   Note: I'm not a smail expert; this file is the result of a couple
  1296. #       of hours of experimentation.                 Rick Lyons.
  1297.  
  1298. /usr/local/bin/faxmail | /usr/local/bin/sendfax -n -d \
  1299.         "`/usr/bin/expr \"$ADDR\" : '\(.*\)\.fax$'`" -f "$SENDER@$PRIMARY_NAME"
  1300. EOF-EOF-EOF
  1301. Patch faxrm/faxrm.c++<<'EOF-EOF-EOF'
  1302. 1c1
  1303. < /*    $Header: /usr/people/sam/fax/faxrm/RCS/faxrm.c++,v 1.13 93/02/28 23:10:57 sam Exp $
  1304. ---
  1305. > /*    $Header: /usr/people/sam/fax/faxrm/RCS/faxrm.c++,v 1.15 93/08/15 11:23:45 sam Exp $
  1306. 25c25
  1307. < #include <getopt.h>
  1308. ---
  1309. > #include <stdlib.h>
  1310. 31,34d30
  1311. < #ifdef __GNUC__
  1312. < extern "C" char* strerror(int);        // XXX should be in <string.h>
  1313. < #endif
  1314. EOF-EOF-EOF
  1315. Patch faxstat/FaxStatClient.c++<<'EOF-EOF-EOF'
  1316. 1c1
  1317. < /*    $Header: /usr/people/sam/fax/faxstat/RCS/FaxStatClient.c++,v 1.5 93/01/26 22:33:58 sam Exp $
  1318. ---
  1319. > /*    $Header: /usr/people/sam/fax/faxstat/RCS/FaxStatClient.c++,v 1.7 93/08/15 11:23:56 sam Exp $
  1320. 25a26
  1321. > #include <string.h>
  1322. 31,34d31
  1323. < #ifdef __GNUC__
  1324. < extern "C" char* strerror(int);        // XXX should be in <string.h>
  1325. < #endif
  1326. EOF-EOF-EOF
  1327. Patch faxstat/faxstat.c++<<'EOF-EOF-EOF'
  1328. 1c1
  1329. < /*    $Header: /usr/people/sam/fax/faxstat/RCS/faxstat.c++,v 1.19 93/04/13 16:14:04 sam Exp $
  1330. ---
  1331. > /*    $Header: /usr/people/sam/fax/faxstat/RCS/faxstat.c++,v 1.20 93/08/13 15:10:25 sam Exp $
  1332. 25c25
  1333. < #include <getopt.h>
  1334. ---
  1335. > #include <stdlib.h>
  1336. EOF-EOF-EOF
  1337. RmFile gs/Makefile.sgi
  1338. Patch gs/README<<'EOF-EOF-EOF'
  1339. 1c1
  1340. < Sat Mar 20 11:46:40 PST 1993
  1341. ---
  1342. > $Header: /usr/people/sam/fax/gs/RCS/README,v 1.4 93/08/15 16:46:50 sam Exp $
  1343. 3,10c3,4
  1344. < This directory holds a fax device driver for version 2.52 of
  1345. < Ghostscript.  If you want to use Ghostscript to convert PostScript to
  1346. < facsimile in the server, you should configure the tiffg3 device into
  1347. < your copy of Ghostscript.  gdevtiff.c is the device driver.  devs.mak
  1348. < is the makefile rules for the device drivers; updated to include the
  1349. < rules for the tiffg3 device.  You will also need to copy or link the
  1350. < file ../libtiff/tiff.h to the Ghostscript directory, or modify the
  1351. < Makefile to search for it in the apppropriate location.
  1352. ---
  1353. > Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993 Sam Leffler
  1354. > Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
  1355. 12,15c6,12
  1356. < Note that if you use Ghostscript to image, you must setup the symbolic
  1357. < link bin/ps2fax in the spooling area to point to bin/ps2fax.gs.  This
  1358. < is usually done during the software configuration process (i.e. when
  1359. < the configure script is run).
  1360. ---
  1361. >     Permission to use, copy, modify, distribute, and sell this software and 
  1362. >     its documentation for any purpose is hereby granted without fee, provided
  1363. >     that (i) the above copyright notices and this permission notice appear in
  1364. >     all copies of the software and related documentation, and (ii) the names of
  1365. >     Sam Leffler and Silicon Graphics may not be used in any advertising or
  1366. >     publicity relating to the software without the specific, prior written
  1367. >     permission of Sam Leffler and Silicon Graphics.
  1368. 17c14,16
  1369. < The files included in this directory:
  1370. ---
  1371. >     THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  1372. >     EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  1373. >     WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  1374. 19,21c18,23
  1375. < Makefile.sgi    Ghostscript makefile for SGI machines (configured w/ tiff*)
  1376. < gdevtiff.c    TIFF G3-encoded image device driver
  1377. < devs.mak    makefile rules for device drivers including gdevtiff.c
  1378. ---
  1379. >     IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  1380. >     ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  1381. >     OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  1382. >     WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  1383. >     LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  1384. >     OF THIS SOFTWARE.
  1385. 23c25,31
  1386. <     Sam
  1387. ---
  1388. > This directory holds a device driver for version 2.6.1 of Ghostscript
  1389. > that write TIFF Class F format files.  It's possible to convert this to
  1390. > work with earlier versions of Ghostscript, but there's little
  1391. > point--just update to a newer version.  The driver included in this
  1392. > distribution is either identical to the version provided with Ghoscript
  1393. > or slightly newer.  You can use either driver, though you are likely to
  1394. > find that the version in this directory has some bugs fixed.
  1395. 25,27c33,46
  1396. < PS. The Ghostscript driver does not support 2D encoding.  This is known
  1397. <     by the ps2fax.gs.sh script that invokes it (it strips out the 1-D/2-D
  1398. <     options supplied by the fax server).
  1399. ---
  1400. > Configure the tiffg3 device by following the directions supplied with
  1401. > the Ghostscript distribution; this basically requires that you add
  1402. > "tiffg3.dev" to the list of configured devices and then rebuild
  1403. > Ghostscript.
  1404. > Note that if you use Ghostscript to image PostScript in the fax server
  1405. > then you must specify "gs" for the PostScript imager when you run the
  1406. > configure script.
  1407. > Beware that the Ghostscript driver does not support 2D encoding.  This
  1408. > is known by the ps2fax.gs.sh script that invokes it (it strips out the
  1409. > 1-D/2-D options supplied by the fax server).
  1410. >     Sam
  1411. EOF-EOF-EOF
  1412. RmFile gs/devs.mak
  1413. Patch gs/gdevtiff.c<<'EOF-EOF-EOF'
  1414. 1c1
  1415. < /* $Header: /usr/people/sam/fax/gs/RCS/gdevtiff.c,v 1.6 93/07/19 08:20:44 sam Exp $ */
  1416. ---
  1417. > /* $Header: /usr/people/sam/fax/gs/RCS/gdevtiff.c,v 1.7 93/08/15 16:33:19 sam Exp $ */
  1418. 30c30
  1419. < #include "tiff.h"
  1420. ---
  1421. > #include "gdevtiff.h"
  1422. 51,52c51
  1423. < private TIFFOUT    *faxout_open PROTO_ARGS((char *));
  1424. < private TIFFOUT    *faxout_open_fp PROTO_ARGS((FILE *));
  1425. ---
  1426. > private void    faxout_open_fp PROTO_ARGS((FILE *, TIFFOUT*));
  1427. 56d54
  1428. < private int    faxout_close PROTO_ARGS((TIFFOUT *));
  1429. 72c70
  1430. <     TIFFOUT*    fax;
  1431. ---
  1432. >     TIFFOUT    fax;
  1433. 76,102d73
  1434. < /*
  1435. <  * Too bad the prn_device() macro doesn't let you specify the
  1436. <  * size of the gx_device structure -- we have to repeat it here
  1437. <  */
  1438. < #define generic_prn_device(Struct, procs, dev_name, width_10ths, height_10ths, x_dpi, y_dpi, l_margin, b_margin, r_margin, t_margin, color_bits, print_page) {\
  1439. <     sizeof (Struct),                        \
  1440. <     &procs,                            \
  1441. <     dev_name,                            \
  1442. <     (int)((long)width_10ths * x_dpi / 10),    /* width */    \
  1443. <     (int)((long)height_10ths * y_dpi / 10),    /* height */    \
  1444. <     x_dpi, y_dpi,                        \
  1445. <     l_margin, b_margin, r_margin, t_margin,            \
  1446. <     { (color_bits > 1 ? 3 : 1),    /* num_components */    \
  1447. <       ((color_bits > 1) & (color_bits < 8) ? 8 : color_bits),    /* depth */\
  1448. <       (color_bits >= 8 ? 255 : 1),        /* max_gray */    \
  1449. <       (color_bits >= 8 ? 255 : color_bits > 1 ? 1 : 0),    /* max_rgb */\
  1450. <       (color_bits >= 8 ? 5 : 2),        /* dither_gray */\
  1451. <       (color_bits >= 8 ? 5 : color_bits > 1 ? 2 : 0),    /* dither_rgb */\
  1452. <     },                                \
  1453. <     0,                        /* not initialized yet */\
  1454. <     { 0 },                    /* skip */    \
  1455. <     print_page,                            \
  1456. <     PRN_MAX_BITMAP,                        \
  1457. <     PRN_BUFFER_SPACE,                        \
  1458. <     { 0 }                    /* fname */    \
  1459. < }
  1460. 115,116c86,87
  1461. < gx_device_tiff gs_tiffg3_device =
  1462. <     generic_prn_device(
  1463. ---
  1464. > gx_device_tiff far_data gs_tiffg3_device =
  1465. > {   prn_device_std_body(
  1466. 126c97,98
  1467. <     );
  1468. ---
  1469. >     )
  1470. > };
  1471. 170,171c142,143
  1472. <     ddev->fax = faxout_open_fp(ddev->file);
  1473. <     ddev->fax->iwidth = pi->iw;
  1474. ---
  1475. >     faxout_open_fp(ddev->file, &ddev->fax);
  1476. >     ddev->fax.iwidth = pi->iw;
  1477. 182c154
  1478. <     TIFFOUT* fax = ddev->fax;
  1479. ---
  1480. >     TIFFOUT* fax = &ddev->fax;
  1481. 200c172
  1482. <     TIFFOUT* fax = ddev->fax;
  1483. ---
  1484. >     TIFFOUT* fax = &ddev->fax;
  1485. 210,211c182,183
  1486. < private TIFFOUT    *
  1487. < faxout_open_fp(FILE *fp)
  1488. ---
  1489. > private void
  1490. > faxout_open_fp(FILE *fp, register TIFFOUT* faxp)
  1491. 213,216d184
  1492. <     register TIFFOUT *faxp;
  1493. <     faxp = (TIFFOUT*) malloc(sizeof (*faxp));
  1494. 220c188
  1495. <     { int one = 1; char* cp = (char*)&one; faxp->bigendian = (*cp == 0); }
  1496. ---
  1497. >     faxp->bigendian = arch_is_big_endian;
  1498. 222,223c190
  1499. <     faxp->fax_weight = 0x80;
  1500. <     return (faxp);
  1501. ---
  1502. >     faxp->fax_weight = 0x01;
  1503. 226,238d192
  1504. < private TIFFOUT    *
  1505. < faxout_open(char *filename)
  1506. < {
  1507. <     register FILE *fp;
  1508. <     register TIFFOUT *faxp;
  1509. <     if (filename)
  1510. <     fp = fopen(filename, "wb");
  1511. <     else
  1512. <     fp = stdout;
  1513. <     return (fp ? faxout_open_fp(fp) : NULL);
  1514. < }
  1515. 276c230
  1516. <     { TIFFTAG_FILLORDER,    TIFF_SHORT, 1, FILLORDER_MSB2LSB },
  1517. ---
  1518. >     { TIFFTAG_FILLORDER,    TIFF_SHORT, 1, FILLORDER_LSB2MSB },
  1519. 375,383c329
  1520. < private int
  1521. < faxout_close(TIFFOUT *faxp)
  1522. < {
  1523. <     fclose(faxp->fp);
  1524. <     free(faxp);
  1525. <     return (0);
  1526. < }
  1527. < private unsigned char b_run_tbl[8][256] = {
  1528. ---
  1529. > private const byte far_data b_run_tbl[8][256] = {
  1530. 530c476
  1531. < private unsigned char w_run_tbl[8][256] = {
  1532. ---
  1533. > private const byte far_data w_run_tbl[8][256] = {
  1534. 803c749
  1535. <     faxp->fax_weight = faxp->fax_weight>>1;
  1536. ---
  1537. >     faxp->fax_weight = faxp->fax_weight<<1;
  1538. 807c753
  1539. <     faxp->fax_weight = 0x80;
  1540. ---
  1541. >     faxp->fax_weight = 0x01;
  1542. 814c760
  1543. <     if (faxp->fax_weight != 0x80) {
  1544. ---
  1545. >     if (faxp->fax_weight != 0x01) {
  1546. 817c763
  1547. <     faxp->fax_weight = 0x80;
  1548. ---
  1549. >     faxp->fax_weight = 0x01;
  1550. EOF-EOF-EOF
  1551. Patch iv/Dispatch/dispatcher.c++<<'EOF-EOF-EOF'
  1552. 591c591
  1553. < void Dispatcher::sigCLD()
  1554. ---
  1555. > void Dispatcher::sigCLD(int)
  1556. 629c629
  1557. <     sv.sv_handler = fxSIGHANDLER(&Dispatcher::sigCLD);
  1558. ---
  1559. >     sv.sv_handler = fxSIGVECHANDLER(&Dispatcher::sigCLD);
  1560. 634c634
  1561. <     sa.sa_handler = fxSIGHANDLER(&Dispatcher::sigCLD);
  1562. ---
  1563. >     sa.sa_handler = fxSIGACTIONHANDLER(&Dispatcher::sigCLD);
  1564. EOF-EOF-EOF
  1565. Patch iv/Dispatch/dispatcher.h<<'EOF-EOF-EOF'
  1566. 94c94
  1567. <     static void sigCLD();
  1568. ---
  1569. >     static void sigCLD(int);
  1570. EOF-EOF-EOF
  1571. Patch iv/InterViews/regexp.c++<<'EOF-EOF-EOF'
  1572. 553c553,557
  1573. <     while (*regparse != '\0' && *regparse != '|' && *regparse != ')') {
  1574. ---
  1575. >     while (*regparse != '\0' && *regparse != '|') {
  1576. >         if (*regparse == '\\' && regparse[1] == ')') {
  1577. >             regparse++;
  1578. >             break;
  1579. >         }
  1580. 694,699d697
  1581. <     case '(':
  1582. <         ret = reg(1, &flags);
  1583. <         if (ret == nil)
  1584. <             return(nil);
  1585. <         *flagp |= flags&(HASWIDTH|SPSTART);
  1586. <         break;
  1587. 702d699
  1588. <     case ')':
  1589. 713,716c710,721
  1590. <         ret = regnode(EXACTLY);
  1591. <         regc(*regparse++);
  1592. <         regc('\0');
  1593. <         *flagp |= HASWIDTH|SIMPLE;
  1594. ---
  1595. >         if (*regparse == '(') {
  1596. >             regparse++;
  1597. >             ret = reg(1, &flags);
  1598. >             if (ret == nil)
  1599. >                 return(nil);
  1600. >             *flagp |= flags&(HASWIDTH|SPSTART);
  1601. >         } else {
  1602. >             ret = regnode(EXACTLY);
  1603. >             regc(*regparse++);
  1604. >             regc('\0');
  1605. >             *flagp |= HASWIDTH|SIMPLE;
  1606. >         }
  1607. EOF-EOF-EOF
  1608. Patch port/386bsd/Makefile.flexfax<<'EOF-EOF-EOF'
  1609. 2c2
  1610. < #    $Header: /usr/people/sam/fax/port/386bsd/RCS/Makefile.flexfax,v 1.7 93/07/09 14:49:19 sam Exp $
  1611. ---
  1612. > #    $Header: /usr/people/sam/fax/port/386bsd/RCS/Makefile.flexfax,v 1.8 93/08/15 18:23:14 sam Exp $
  1613. 78a79
  1614. >     rm -f port.h
  1615. EOF-EOF-EOF
  1616. Patch port/386bsd/defs<<'EOF-EOF-EOF'
  1617. 1c1
  1618. < #    $Header: /usr/people/sam/fax/port/386bsd/RCS/defs,v 1.19 93/07/30 11:51:41 sam Exp $
  1619. ---
  1620. > #    $Header: /usr/people/sam/fax/port/386bsd/RCS/defs,v 1.20 93/08/13 15:15:53 sam Exp $
  1621. 229c229
  1622. < GCINCS=    -I- -I. -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${TIFF}
  1623. ---
  1624. > GCINCS=    -I- -I. -I${DEPTH} -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${TIFF}
  1625. 244c244,245
  1626. < GC++INCS=-I. -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1627. ---
  1628. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} \
  1629. >     -I${IV} -I${TIFF}
  1630. EOF-EOF-EOF
  1631. Patch port/4.4bsd/Makefile.flexfax<<'EOF-EOF-EOF'
  1632. 2c2
  1633. < #    $Header: /usr/people/sam/fax/port/4.4bsd/RCS/Makefile.flexfax,v 1.4 93/07/09 14:49:27 sam Exp $
  1634. ---
  1635. > #    $Header: /usr/people/sam/fax/port/4.4bsd/RCS/Makefile.flexfax,v 1.5 93/08/15 18:23:22 sam Exp $
  1636. 79a80
  1637. >     rm -f port.h
  1638. EOF-EOF-EOF
  1639. Patch port/4.4bsd/defs<<'EOF-EOF-EOF'
  1640. 1c1
  1641. < #    $Header: /usr/people/sam/fax/port/4.4bsd/RCS/defs,v 1.4 93/07/27 12:22:30 sam Exp $
  1642. ---
  1643. > #    $Header: /usr/people/sam/fax/port/4.4bsd/RCS/defs,v 1.5 93/08/13 15:16:07 sam Exp $
  1644. 227c227
  1645. < GCINCS=    -I- -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1646. ---
  1647. > GCINCS=    -I- -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1648. EOF-EOF-EOF
  1649. RmFile port/4.4bsd/malloc.h
  1650. Patch port/bsdi/Makefile.flexfax<<'EOF-EOF-EOF'
  1651. 2c2
  1652. < #    $Header: /usr/people/sam/fax/port/bsdi/RCS/Makefile.flexfax,v 1.14 93/07/09 14:49:28 sam Exp $
  1653. ---
  1654. > #    $Header: /usr/people/sam/fax/port/bsdi/RCS/Makefile.flexfax,v 1.15 93/08/15 18:23:25 sam Exp $
  1655. 79a80
  1656. >     rm -f port.h
  1657. EOF-EOF-EOF
  1658. Patch port/bsdi/defs<<'EOF-EOF-EOF'
  1659. 1c1
  1660. < #    $Header: /usr/people/sam/fax/port/bsdi/RCS/defs,v 1.23 93/07/27 12:22:31 sam Exp $
  1661. ---
  1662. > #    $Header: /usr/people/sam/fax/port/bsdi/RCS/defs,v 1.24 93/08/13 15:16:09 sam Exp $
  1663. 227c227
  1664. < GCINCS=    -I- -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1665. ---
  1666. > GCINCS=    -I- -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1667. 242c242
  1668. < GC++INCS=-I. -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1669. ---
  1670. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1671. EOF-EOF-EOF
  1672. RmFile port/bsdi/malloc.h
  1673. Patch port/freebsd/Makefile.flexfax<<'EOF-EOF-EOF'
  1674. 2c2
  1675. < #    $Header: /usr/people/sam/fax/port/freebsd/RCS/Makefile.flexfax,v 1.1 93/07/29 17:01:34 sam Exp $
  1676. ---
  1677. > #    $Header: /usr/people/sam/fax/port/freebsd/RCS/Makefile.flexfax,v 1.2 93/08/15 18:23:27 sam Exp $
  1678. 78a79
  1679. >     rm -f port.h
  1680. EOF-EOF-EOF
  1681. Patch port/freebsd/defs<<'EOF-EOF-EOF'
  1682. 1c1
  1683. < #    $Header: /usr/people/sam/fax/port/freebsd/RCS/defs,v 1.1 93/07/29 17:01:36 sam Exp $
  1684. ---
  1685. > #    $Header: /usr/people/sam/fax/port/freebsd/RCS/defs,v 1.2 93/08/13 15:16:10 sam Exp $
  1686. 229c229
  1687. < GCINCS=    -I- -I. -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${TIFF}
  1688. ---
  1689. > GCINCS=    -I- -I. -I${DEPTH} -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${TIFF}
  1690. 244c244,245
  1691. < GC++INCS=-I. -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1692. ---
  1693. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${BSDI} -I${GENERIC} -I${UTIL} \
  1694. >     -I${IV} -I${TIFF}
  1695. EOF-EOF-EOF
  1696. Patch port/freebsd/paths.h<<'EOF-EOF-EOF'
  1697. 4a5
  1698. > #ifndef _PATH_GETTY
  1699. 5a7
  1700. > #endif
  1701. EOF-EOF-EOF
  1702. NewFile port/freebsd/signal.h<<'EOF-EOF-EOF'
  1703. #include_next <signal.h>
  1704. #ifndef SIGCLD
  1705. #define SIGCLD SIGCHLD
  1706. #endif
  1707. EOF-EOF-EOF
  1708. RmFile port/generic/getopt.h
  1709. Patch port/linux/Makefile.flexfax<<'EOF-EOF-EOF'
  1710. 2c2
  1711. < #    $Header: /usr/people/sam/fax/port/linux/RCS/Makefile.flexfax,v 1.2 93/07/09 14:49:28 sam Exp $
  1712. ---
  1713. > #    $Header: /usr/people/sam/fax/port/linux/RCS/Makefile.flexfax,v 1.3 93/08/15 18:23:28 sam Exp $
  1714. 78a79
  1715. >     rm -f port.h
  1716. EOF-EOF-EOF
  1717. Patch port/linux/defs<<'EOF-EOF-EOF'
  1718. 1c1
  1719. < #    $Header: /usr/people/sam/fax/port/linux/RCS/defs,v 1.2 93/07/27 12:22:32 sam Exp $
  1720. ---
  1721. > #    $Header: /usr/people/sam/fax/port/linux/RCS/defs,v 1.3 93/08/13 15:16:17 sam Exp $
  1722. 230c230
  1723. < GCINCS=    -I- -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1724. ---
  1725. > GCINCS=    -I- -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1726. 245c245
  1727. < GC++INCS=-I. -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1728. ---
  1729. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1730. EOF-EOF-EOF
  1731. RmFile port/linux/sys
  1732. Patch port/sco/Makefile.flexfax<<'EOF-EOF-EOF'
  1733. 2c2
  1734. < #    $Header: /usr/people/sam/fax/port/sco/RCS/Makefile.flexfax,v 1.6 93/07/09 14:49:29 sam Exp $
  1735. ---
  1736. > #    $Header: /usr/people/sam/fax/port/sco/RCS/Makefile.flexfax,v 1.7 93/08/15 18:23:31 sam Exp $
  1737. 79a80
  1738. >     rm -f port.h
  1739. EOF-EOF-EOF
  1740. Patch port/sco/defs<<'EOF-EOF-EOF'
  1741. 1c1
  1742. < #    $Header: /usr/people/sam/fax/port/sco/RCS/defs,v 1.6 93/07/27 12:22:32 sam Exp $
  1743. ---
  1744. > #    $Header: /usr/people/sam/fax/port/sco/RCS/defs,v 1.7 93/08/13 15:16:20 sam Exp $
  1745. 229c229
  1746. < GCINCS=    -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1747. ---
  1748. > GCINCS=    -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1749. 244c244
  1750. < GC++INCS=-I. -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1751. ---
  1752. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1753. EOF-EOF-EOF
  1754. Patch port/sgi/Makefile.flexfax<<'EOF-EOF-EOF'
  1755. 2c2
  1756. < #    $Header: /usr/people/sam/fax/port/sgi/RCS/Makefile.flexfax,v 1.56 93/08/02 09:37:21 sam Exp $
  1757. ---
  1758. > #    $Header: /usr/people/sam/fax/port/sgi/RCS/Makefile.flexfax,v 1.57 93/08/15 18:23:32 sam Exp $
  1759. 79a80
  1760. >     rm -f port.h
  1761. EOF-EOF-EOF
  1762. Patch port/sgi/defs.cc<<'EOF-EOF-EOF'
  1763. 1c1
  1764. < #    $Header: /usr/people/sam/fax/port/sgi/RCS/defs.cc,v 1.36 93/06/18 11:46:20 sam Exp $
  1765. ---
  1766. > #    $Header: /usr/people/sam/fax/port/sgi/RCS/defs.cc,v 1.38 93/08/15 23:35:17 sam Exp $
  1767. 236c236
  1768. < GCINCS=-I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1769. ---
  1770. > GCINCS=-I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1771. 250,251c250,251
  1772. < GC++OPTS=+a1 +w +p -v2 -float ${OPTIMIZER}
  1773. < GC++INCS=-I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF} \
  1774. ---
  1775. > GC++OPTS=+a1 +w +p -float ${OPTIMIZER}
  1776. > GC++INCS=-I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF} \
  1777. EOF-EOF-EOF
  1778. Patch port/sgi/defs.gcc<<'EOF-EOF-EOF'
  1779. 1c1
  1780. < #    $Header: /usr/people/sam/fax/port/sgi/RCS/defs.gcc,v 1.10 93/06/18 11:46:21 sam Exp $
  1781. ---
  1782. > #    $Header: /usr/people/sam/fax/port/sgi/RCS/defs.gcc,v 1.11 93/08/13 15:16:22 sam Exp $
  1783. 236c236
  1784. < GCINCS    = -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1785. ---
  1786. > GCINCS    = -I ${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1787. 251c251
  1788. < GC++INCS= -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1789. ---
  1790. > GC++INCS= -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1791. EOF-EOF-EOF
  1792. RmFile port/sgi/getopt.h
  1793. RmFile port/sgi/sys
  1794. Patch port/solaris2/Makefile.flexfax<<'EOF-EOF-EOF'
  1795. 2c2
  1796. < #    $Header: /usr/people/sam/fax/port/solaris2/RCS/Makefile.flexfax,v 1.6 93/07/09 14:49:31 sam Exp $
  1797. ---
  1798. > #    $Header: /usr/people/sam/fax/port/solaris2/RCS/Makefile.flexfax,v 1.7 93/08/15 18:23:33 sam Exp $
  1799. 78a79
  1800. >     rm -f port.h
  1801. EOF-EOF-EOF
  1802. Patch port/solaris2/defs<<'EOF-EOF-EOF'
  1803. 1c1
  1804. < #    $Header: /usr/people/sam/fax/port/solaris2/RCS/defs,v 1.8 93/07/27 12:22:33 sam Exp $
  1805. ---
  1806. > #    $Header: /usr/people/sam/fax/port/solaris2/RCS/defs,v 1.9 93/08/13 15:16:23 sam Exp $
  1807. 231c231
  1808. < GCINCS=    -I. -I${PORT} -I${PORTSVR4} -I${GENERIC} -I${UTIL} -I${TIFF}
  1809. ---
  1810. > GCINCS=    -I. -I${DEPTH} -I${PORT} -I${PORTSVR4} -I${GENERIC} -I${UTIL} -I${TIFF}
  1811. 246c246,247
  1812. < GC++INCS=-I. -I${PORT} -I${PORTSVR4} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1813. ---
  1814. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${PORTSVR4} -I${GENERIC} -I${UTIL} \
  1815. >     -I${IV} -I${TIFF}
  1816. EOF-EOF-EOF
  1817. Patch port/sun/Makefile.flexfax<<'EOF-EOF-EOF'
  1818. 2c2
  1819. < #    $Header: /usr/people/sam/fax/port/sun/RCS/Makefile.flexfax,v 1.29 93/07/09 14:49:31 sam Exp $
  1820. ---
  1821. > #    $Header: /usr/people/sam/fax/port/sun/RCS/Makefile.flexfax,v 1.30 93/08/15 18:23:34 sam Exp $
  1822. 78a79
  1823. >     rm -f port.h
  1824. EOF-EOF-EOF
  1825. Patch port/sun/defs<<'EOF-EOF-EOF'
  1826. 1c1
  1827. < #    $Header: /usr/people/sam/fax/port/sun/RCS/defs,v 1.29 93/07/27 12:22:34 sam Exp $
  1828. ---
  1829. > #    $Header: /usr/people/sam/fax/port/sun/RCS/defs,v 1.30 93/08/13 15:16:24 sam Exp $
  1830. 222c222
  1831. < GCINCS=    -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1832. ---
  1833. > GCINCS=    -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1834. 237c237
  1835. < GC++INCS=-I. -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1836. ---
  1837. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1838. EOF-EOF-EOF
  1839. RmFile port/sun/sys
  1840. Patch port/svr4/Makefile.flexfax<<'EOF-EOF-EOF'
  1841. 2c2
  1842. < #    $Header: /usr/people/sam/fax/port/svr4/RCS/Makefile.flexfax,v 1.8 93/07/09 14:49:32 sam Exp $
  1843. ---
  1844. > #    $Header: /usr/people/sam/fax/port/svr4/RCS/Makefile.flexfax,v 1.9 93/08/15 18:23:35 sam Exp $
  1845. 78a79
  1846. >     rm -f port.h
  1847. EOF-EOF-EOF
  1848. Patch port/svr4/defs<<'EOF-EOF-EOF'
  1849. 1c1
  1850. < #    $Header: /usr/people/sam/fax/port/svr4/RCS/defs,v 1.13 93/07/27 12:22:35 sam Exp $
  1851. ---
  1852. > #    $Header: /usr/people/sam/fax/port/svr4/RCS/defs,v 1.14 93/08/13 15:16:25 sam Exp $
  1853. 230c230
  1854. < GCINCS=    -I. -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1855. ---
  1856. > GCINCS=    -I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${TIFF}
  1857. 245c245
  1858. < GC++INCS=-I. -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1859. ---
  1860. > GC++INCS=-I. -I${DEPTH} -I${PORT} -I${GENERIC} -I${UTIL} -I${IV} -I${TIFF}
  1861. EOF-EOF-EOF
  1862. Patch recvfax/alter.c<<'EOF-EOF-EOF'
  1863. 1c1
  1864. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/alter.c,v 1.9 93/07/26 10:58:49 sam Exp $
  1865. ---
  1866. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/alter.c,v 1.10 93/08/14 19:51:02 sam Exp $
  1867. 27d26
  1868. < #include <sys/types.h>
  1869. EOF-EOF-EOF
  1870. Patch recvfax/auth.c<<'EOF-EOF-EOF'
  1871. 1c1
  1872. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/auth.c,v 1.8 93/03/31 15:01:14 sam Exp $
  1873. ---
  1874. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/auth.c,v 1.9 93/08/14 19:51:29 sam Exp $
  1875. 27d26
  1876. < #include <sys/types.h>
  1877. EOF-EOF-EOF
  1878. Patch recvfax/defs.h<<'EOF-EOF-EOF'
  1879. 1c1
  1880. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/defs.h,v 1.14 93/07/26 10:59:27 sam Exp $
  1881. ---
  1882. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/defs.h,v 1.16 93/08/14 19:51:30 sam Exp $
  1883. 29a30
  1884. > #include <sys/types.h>
  1885. 35a37,38
  1886. > #include "port.h"
  1887. EOF-EOF-EOF
  1888. Patch recvfax/jobs.c<<'EOF-EOF-EOF'
  1889. 1c1
  1890. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/jobs.c,v 1.20 93/07/26 10:59:28 sam Exp $
  1891. ---
  1892. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/jobs.c,v 1.21 93/08/14 19:51:31 sam Exp $
  1893. 27d26
  1894. < #include <sys/types.h>
  1895. 31c30
  1896. < #include <malloc.h>
  1897. ---
  1898. > #include <stdlib.h>
  1899. EOF-EOF-EOF
  1900. Patch recvfax/remove.c<<'EOF-EOF-EOF'
  1901. 1c1
  1902. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/remove.c,v 1.11 93/07/26 10:59:30 sam Exp $
  1903. ---
  1904. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/remove.c,v 1.12 93/08/14 19:51:32 sam Exp $
  1905. 27d26
  1906. < #include <sys/types.h>
  1907. EOF-EOF-EOF
  1908. Patch recvfax/status.c<<'EOF-EOF-EOF'
  1909. 1c1
  1910. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/status.c,v 1.20 93/07/26 10:59:31 sam Exp $
  1911. ---
  1912. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/status.c,v 1.21 93/08/12 17:15:28 sam Exp $
  1913. 273c273
  1914. < #ifdef svr4
  1915. ---
  1916. > #if defined(svr4) || defined(hpux)
  1917. EOF-EOF-EOF
  1918. Patch recvfax/submit.c<<'EOF-EOF-EOF'
  1919. 1c1
  1920. < /*    $Header: /usr/people/sam/fax/recvfax/RCS/submit.c,v 1.19 93/07/26 10:59:32 sam Exp $
  1921. ---
  1922. > /*    $Header: /usr/people/sam/fax/recvfax/RCS/submit.c,v 1.20 93/08/14 19:51:32 sam Exp $
  1923. 30c30
  1924. < #include <malloc.h>
  1925. ---
  1926. > #include <stdlib.h>
  1927. EOF-EOF-EOF
  1928. Patch sendfax/sendfax.c++<<'EOF-EOF-EOF'
  1929. 1c1
  1930. < /*    $Header: /usr/people/sam/fax/sendfax/RCS/sendfax.c++,v 1.53 93/07/27 12:22:54 sam Exp $
  1931. ---
  1932. > /*    $Header: /usr/people/sam/fax/sendfax/RCS/sendfax.c++,v 1.56 93/08/15 11:24:09 sam Exp $
  1933. 32c32
  1934. < #include <getopt.h>
  1935. ---
  1936. > #include <stdlib.h>
  1937. 36d35
  1938. 41,42d39
  1939. <     int close(int);
  1940. 217a215,223
  1941. >     if (db && dest.length() > 0) {
  1942. >     fxStr name;
  1943. >     FaxDBRecord* r = db->find(dest, &name);
  1944. >     if (r) {
  1945. >         if (recipient == "")
  1946. >         recipient = name;
  1947. >         dest = r->find(FaxDB::numberKey);
  1948. >     }
  1949. >     }
  1950. 244,245d249
  1951. < extern "C" int mkstemp(char*);
  1952. EOF-EOF-EOF
  1953. Patch util/Array.c++<<'EOF-EOF-EOF'
  1954. 1c1
  1955. < /*    $Header: /usr/people/sam/fax/util/RCS/Array.c++,v 1.6 93/01/13 18:54:13 sam Exp $
  1956. ---
  1957. > /*    $Header: /usr/people/sam/fax/util/RCS/Array.c++,v 1.8 93/08/15 11:22:29 sam Exp $
  1958. 26,27c26
  1959. < #include "malloc.h"
  1960. < #include "libc.h"
  1961. ---
  1962. > #include <stdlib.h>
  1963. EOF-EOF-EOF
  1964. Patch util/Array.h<<'EOF-EOF-EOF'
  1965. 1c1
  1966. < /*    $Header: /usr/people/sam/fax/util/RCS/Array.h,v 1.4 93/03/11 11:52:26 sam Exp $
  1967. ---
  1968. > /*    $Header: /usr/people/sam/fax/util/RCS/Array.h,v 1.5 93/08/12 16:45:53 sam Exp $
  1969. 27,28c27,28
  1970. < // $Revision: 1.4 $
  1971. < // $Date: 93/03/11 11:52:26 $
  1972. ---
  1973. > // $Revision: 1.5 $
  1974. > // $Date: 93/08/12 16:45:53 $
  1975. 321c321
  1976. <     bzero(start,numbytes);                        \
  1977. ---
  1978. >     memset(start,0,numbytes);                    \
  1979. EOF-EOF-EOF
  1980. Patch util/AtSyntax.c++<<'EOF-EOF-EOF'
  1981. 1c1
  1982. < /*    $Header: /usr/people/sam/fax/util/RCS/AtSyntax.c++,v 1.2 93/07/25 12:50:10 sam Exp $
  1983. ---
  1984. > /*    $Header: /usr/people/sam/fax/util/RCS/AtSyntax.c++,v 1.4 93/08/15 11:22:36 sam Exp $
  1985. EOF-EOF-EOF
  1986. Patch util/FaxClient.c++<<'EOF-EOF-EOF'
  1987. 1c1
  1988. < /*    $Header: /usr/people/sam/fax/util/RCS/FaxClient.c++,v 1.28 93/07/16 10:29:53 sam Exp $
  1989. ---
  1990. > /*    $Header: /usr/people/sam/fax/util/RCS/FaxClient.c++,v 1.30 93/08/16 08:19:05 sam Exp $
  1991. 232a233,238
  1992. > FaxClient::sendLine(const char* cmd, const fxStr& s)
  1993. > {
  1994. >     sendLine(cmd, (char*) s);
  1995. > }
  1996. > void
  1997. 315a322
  1998. >     prevcc = 0;
  1999. EOF-EOF-EOF
  2000. Patch util/FaxClient.h<<'EOF-EOF-EOF'
  2001. 1c1
  2002. < /*    $Header: /usr/people/sam/fax/util/RCS/FaxClient.h,v 1.13 93/01/24 17:15:22 sam Exp $
  2003. ---
  2004. > /*    $Header: /usr/people/sam/fax/util/RCS/FaxClient.h,v 1.14 93/08/16 08:18:53 sam Exp $
  2005. 96,97c96
  2006. <     virtual void sendLine(const char* cmd, const fxStr& s)
  2007. <     { sendLine(cmd, (char*) s); }
  2008. ---
  2009. >     virtual void sendLine(const char* cmd, const fxStr& s);
  2010. EOF-EOF-EOF
  2011. Patch util/Obj.c++<<'EOF-EOF-EOF'
  2012. 1c1
  2013. < /*    $Header: /usr/people/sam/fax/util/RCS/Obj.c++,v 1.2 93/01/13 18:54:20 sam Exp $
  2014. ---
  2015. > /*    $Header: /usr/people/sam/fax/util/RCS/Obj.c++,v 1.3 93/08/16 08:19:19 sam Exp $
  2016. 28a29
  2017. > fxObj::~fxObj()    { }
  2018. EOF-EOF-EOF
  2019. Patch util/Obj.h<<'EOF-EOF-EOF'
  2020. 1c1
  2021. < /*    $Header: /usr/people/sam/fax/util/RCS/Obj.h,v 1.2 93/01/13 18:54:20 sam Exp $
  2022. ---
  2023. > /*    $Header: /usr/people/sam/fax/util/RCS/Obj.h,v 1.3 93/08/16 08:19:11 sam Exp $
  2024. 28,29c28,29
  2025. < // $Revision: 1.2 $
  2026. < // $Date: 93/01/13 18:54:20 $
  2027. ---
  2028. > // $Revision: 1.3 $
  2029. > // $Date: 93/08/16 08:19:11 $
  2030. 52d51
  2031. < inline fxObj::~fxObj()                { }
  2032. EOF-EOF-EOF
  2033. Patch util/PageSize.c++<<'EOF-EOF-EOF'
  2034. 1c1
  2035. < /*    $Header: /usr/people/sam/fax/util/RCS/PageSize.c++,v 1.8 93/06/28 16:59:40 sam Exp $
  2036. ---
  2037. > /*    $Header: /usr/people/sam/fax/util/RCS/PageSize.c++,v 1.10 93/08/15 11:22:37 sam Exp $
  2038. 36,40d35
  2039. < #ifdef __GNUC__
  2040. < extern    "C" int strncasecmp(const char *, const char *, size_t);
  2041. < extern    "C" unsigned long int strtoul(const char *, char **, int);
  2042. < #endif
  2043. EOF-EOF-EOF
  2044. Patch util/SendFaxClient.c++<<'EOF-EOF-EOF'
  2045. 1c1
  2046. < /*    $Header: /usr/people/sam/fax/util/RCS/SendFaxClient.c++,v 1.11 93/07/27 12:22:08 sam Exp $
  2047. ---
  2048. > /*    $Header: /usr/people/sam/fax/util/RCS/SendFaxClient.c++,v 1.13 93/08/15 11:22:38 sam Exp $
  2049. 34a35
  2050. > #include <string.h>
  2051. 39,45d39
  2052. < #ifndef __linux__
  2053. <     int gethostname(char*, int);
  2054. < #endif
  2055. < #ifdef __GNUC__
  2056. <     char* strerror(int);
  2057. < #endif
  2058. 54,55d47
  2059. < extern "C" int mkstemp(char*);
  2060. EOF-EOF-EOF
  2061. Patch util/StackBuffer.c++<<'EOF-EOF-EOF'
  2062. 1c1
  2063. < /*    $Header: /usr/people/sam/fax/util/RCS/StackBuffer.c++,v 1.3 93/01/13 18:54:22 sam Exp $
  2064. ---
  2065. > /*    $Header: /usr/people/sam/fax/util/RCS/StackBuffer.c++,v 1.5 93/08/15 11:22:39 sam Exp $
  2066. 26,27c26
  2067. < #include "libc.h"
  2068. < #include "malloc.h"
  2069. ---
  2070. > #include <stdlib.h>
  2071. EOF-EOF-EOF
  2072. Patch util/Str.c++<<'EOF-EOF-EOF'
  2073. 1c1
  2074. < /*    $Header: /usr/people/sam/fax/util/RCS/Str.c++,v 1.13 93/05/03 17:15:02 sam Exp $
  2075. ---
  2076. > /*    $Header: /usr/people/sam/fax/util/RCS/Str.c++,v 1.15 93/08/15 11:22:39 sam Exp $
  2077. 26,28c26,27
  2078. < #include "malloc.h"
  2079. < #include "ctype.h"
  2080. < #include "libc.h"
  2081. ---
  2082. > #include <stdlib.h>
  2083. > #include <ctype.h>
  2084. EOF-EOF-EOF
  2085. Patch util/TypeRules.c++<<'EOF-EOF-EOF'
  2086. 1c1
  2087. < /*    $Header: /usr/people/sam/fax/util/RCS/TypeRules.c++,v 1.12 93/06/18 11:44:20 sam Exp $
  2088. ---
  2089. > /*    $Header: /usr/people/sam/fax/util/RCS/TypeRules.c++,v 1.15 93/08/16 08:19:24 sam Exp $
  2090. 32,35c32,33
  2091. < #ifdef __GNUC__
  2092. < extern    "C" int strncasecmp(const char *, const char *, size_t);
  2093. < extern    "C" unsigned long int strtoul(const char *, char **, int);
  2094. < #endif
  2095. ---
  2096. > #include <string.h>
  2097. > #include <stdlib.h>
  2098. 81c79,80
  2099. <     for (u_int i = 0; i < size; i++)
  2100. ---
  2101. >     u_int i;
  2102. >     for (i = 0; i < size; i++)
  2103. EOF-EOF-EOF
  2104. Patch util/Types.h<<'EOF-EOF-EOF'
  2105. 1c1
  2106. < /*    $Header: /usr/people/sam/fax/util/RCS/Types.h,v 1.10 93/02/21 17:56:58 sam Exp $
  2107. ---
  2108. > /*    $Header: /usr/people/sam/fax/util/RCS/Types.h,v 1.11 93/08/15 10:45:28 sam Exp $
  2109. 32a33
  2110. > #include "port.h"
  2111. EOF-EOF-EOF
  2112. Patch util/faxanswer.c<<'EOF-EOF-EOF'
  2113. 1c1
  2114. < /*    $Header: /usr/people/sam/fax/util/RCS/faxanswer.c,v 1.12 93/05/10 09:27:22 sam Exp $
  2115. ---
  2116. > /*    $Header: /usr/people/sam/fax/util/RCS/faxanswer.c,v 1.13 93/08/13 15:15:22 sam Exp $
  2117. 32a33
  2118. > #include "port.h"
  2119. EOF-EOF-EOF
  2120. Patch util/faxquit.c<<'EOF-EOF-EOF'
  2121. 1c1
  2122. < /*    $Header: /usr/people/sam/fax/util/RCS/faxquit.c,v 1.11 93/03/31 14:59:04 sam Exp $
  2123. ---
  2124. > /*    $Header: /usr/people/sam/fax/util/RCS/faxquit.c,v 1.12 93/08/13 15:15:24 sam Exp $
  2125. 32a33
  2126. > #include "port.h"
  2127. EOF-EOF-EOF
  2128. Patch util/notify.sh<<'EOF-EOF-EOF'
  2129. 2c2
  2130. < #    $Header: /usr/people/sam/fax/util/RCS/notify.sh,v 1.4 93/07/31 18:20:33 sam Exp $
  2131. ---
  2132. > #    $Header: /usr/people/sam/fax/util/RCS/notify.sh,v 1.5 93/08/07 19:37:04 sam Exp $
  2133. 160c160
  2134. <         print "Additional information:\n    " status;
  2135. ---
  2136. >         print "  Additional information:\n    " status;
  2137. EOF-EOF-EOF
  2138. Patch util/textfmt.c++<<'EOF-EOF-EOF'
  2139. 1c1
  2140. < /*    $Header: /usr/people/sam/fax/util/RCS/textfmt.c++,v 1.17 93/07/29 14:01:58 sam Exp $
  2141. ---
  2142. > /*    $Header: /usr/people/sam/fax/util/RCS/textfmt.c++,v 1.20 93/08/15 11:22:41 sam Exp $
  2143. 41d40
  2144. < #include <getopt.h>
  2145. 45a45,47
  2146. > extern "C" {
  2147. > #include <locale.h>
  2148. > }
  2149. 47,50d48
  2150. < #ifdef __GNUC__
  2151. < extern    "C" int strncasecmp(const char *, const char *, size_t);
  2152. < #endif
  2153. 126a125,127
  2154. > #ifdef LC_CTYPE
  2155. >     setlocale(LC_CTYPE, "");
  2156. > #endif
  2157. EOF-EOF-EOF
  2158.